Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v4 #439 +/- ##
=====================================
Coverage ? 94.02%
=====================================
Files ? 2
Lines ? 1072
Branches ? 139
=====================================
Hits ? 1008
Misses ? 64
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Same one-line script change as satorijs#438. It is only here so this branch can run its own tests before satorijs#438 lands; drop it when rebasing on v4 after satorijs#438 is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
createAssetFactorydeclares its input asBinary.Source, which is anArrayBufferor anyArrayBufferView. The view branch dereferenced.bufferbefore encoding:An
ArrayBufferViewis a window onto a buffer: its bytes arebyteOffset..byteOffset + byteLength, not the whole backing store. Passing.buffertherefore encodes every byte the view was carved out of. A three-byte view into a six-byte buffer yieldsbase64://AAABAgMAinstead ofbase64://AQID; the same happens forDataViewand for themime typeform offile().Fix
Binary.toBase64already handles a view correctly, so pass the view itself:Relation to #431
This is the same fix as
#431, which targetsmain.mainis no longer where development happens: its install has been broken since 2026-10-07 on an unpublished dependency, and active work moved tov4. This PR is thev4version of the change;#431is superseded by it.Tests
Adds
packages/element/tests/index.spec.ts, coveringstring,Buffer,ArrayBuffer, aUint8Arrayview with a non-zerobyteOffset, aDataView, and themime typevariant — the same cases as#431.Red before the fix (reproduced twice, identical):
Green after the fix:
Both element test files together:
ℹ tests 19 / pass 19 / fail 0.pnpm exec yakumo build element— exit 0pnpm lint— exit 0pnpm exec eslint packages/element/tests/index.spec.ts --no-ignore— exit 0 (the repo's.eslintignoreexcludestests, so this is informational)Because the
v4testscript still does not forward thetsxloader to thenode --testchild, the tests above were run directly withnode --import tsx --test packages/element/tests/*.spec.ts.CI
lintandbuildpass.test (20)/test (22)currently fail on this PR, but they fail at load time, before any assertion runs, because the base branch'stestscript still drops the loader: the new file hitsERR_UNSUPPORTED_TYPESCRIPT_SYNTAX(namespaceinsrc),segment.spec.tshitsERR_UNSUPPORTED_DIR_IMPORT, andprotocol.spec.tshitsERR_MODULE_NOT_FOUNDfor@satorijs/element/lib. That is the pre-existingv4test failure fixed separately by #438 (which makes bothtestjobs green); once #438 is onv4, this PR's test jobs will exercise the new cases.publishis skipped on pull requests; the redpublishjob onv4's head is unrelated to this change.