Repository navigation
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
|
GitGuardian fails here on incident 37585749, which is not from this PR. The flagged commits (4f6fe33, 49ac330, 1d80224) come from #1767 through the base branch. The hit is a false positive: a test fixture in Generated by Claude Code |
encodeAuthOk, encodeError, encodeCommitOk(Slim), encodeChallenge, encodeSyncResend and decodeHelloCaps are frames only a server sends or reads. The browser client never calls them; only the tests do, to play the server. They now live in browser/lib/src/test-ws-v2-server.ts, and ws-v2.ts keeps only what the client uses.
2b4e398 to
9030c48
Compare
|
Landed on develop in 4a3a0bf via the combined batch #1852 (green on Mancave). Closing. Generated by Claude Code |
Requested by Joep · project thread
Before: the browser's wire codec
browser/lib/src/ws-v2.tsalso held the encoders for frames only a server sends (AUTH_OK, ERROR, COMMIT_OK full and slim, CHALLENGE, SYNC_RESEND) and the decoder for another client's HELLO capabilities. The client never calls them; only the tests do, to play the server.After: those seven functions live in
browser/lib/src/test-ws-v2-server.ts, next totest-store.ts, andws-v2.tsholds only what the client uses. Nothing a user sees changes.How: moved
encodeAuthOk,encodeError,encodeCommitOk,encodeCommitOkSlim,encodeChallenge,encodeSyncResendanddecodeHelloCapsverbatim (with small privatewriteU16/readU16copies) and pointedws-v2.test.tsandwebsockets.test.tsat the new file.decodeGetanddecodeGetManystay:debugFrameInfouses them to log the client's own outgoing GET / GET_MANY frames.Public API:
ws-v2.tsis not re-exported from@tomic/lib'sindex.tsand is not in the packageexports, so no published API changes. Nothing in data-browser, react, e2e or other packages imported the moved functions. The only outside consumer ofws-v2.tsis data-browser's E2E-onlye2eModules.ts, which takes it as a namespace and whose specs only useencodeSyncPush(a client frame, kept).Bundle size: the release build of
@tomic/libis byte-for-byte the same size before and after (dist/*.js+*.cjs= 848,508 bytes), because tsup/esbuild already tree-shook these unused exports. So the shipped bundle did not actually carry them; this PR is a source cleanup (the codec file now reads as the client's codec), and it trims the namespace import in the E2E-only build.Tests
browser/lib:pnpm exec vitest run: 125 files passed, 1010 tests passed (1 skipped).pnpm exec tsc --noEmit: clean.pnpm run lint: clean.browser/data-browser:pnpm exec tsc --noEmit: the same 16 pre-existing error lines as the base (unbuilt workspace packages), none touching ws-v2.pnpm exec tsupbefore and after: identical output size.