Skip to content

fix(diff): preserve E2E decryption key on label sync + add A/B line counters; uplift Docker#1

Merged
mxhob1 merged 4 commits into
developfrom
fix/encrypted-diff-link-and-line-counters
Jun 3, 2026
Merged

fix(diff): preserve E2E decryption key on label sync + add A/B line counters; uplift Docker#1
mxhob1 merged 4 commits into
developfrom
fix/encrypted-diff-link-and-line-counters

Conversation

@mxhob1

@mxhob1 mxhob1 commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Two user-facing fixes plus a build uplift.

1. Encrypted share links break on refresh ("We couldn't decrypt your diff")

On the ?id= (end-to-end-encrypted) path the URL hash holds the AES decryption key (#s-…), not the diff payload. syncLabelsToUrl() fired when unzipCommitData() set the pane labels after decryption and replaceState'd the hash with the gzipped payload (#H4sI…). On refresh/re-copy, getE2EData() then read that payload as the key → decryption failed.

New pure helper buildLabelSyncUrl() returns null on the ?id= path so the key is never clobbered. Covered by helpers/labelSyncUrl.test.ts.

2. Per-side line counters

Adds an A / B line-count display with a colour-coded net delta (b − a) to the diff action bar, computed reactively from the store payload (matches the Monaco gutter). Hidden under 640px. Pure stats logic in helpers/lineStats.ts + tests.

3. Docker / engines uplift

  • Build image node:22node:24 (current LTS); production nginx:1.27.0 (old mainline) → nginx:1.28.3-alpine-slim (current stable, pinned).
  • engines.node 22.x>=22; CI matrix node 2022.
  • Retained --openssl-legacy-provider (webpack 4 / MD4 vs OpenSSL 3) with an explanatory comment.

Test infra

Added @types/jest + tsconfig.jest.json so specs type-check without polluting the app build; *.test.ts excluded from the app tsconfig.

Verification

  • npm test — 13 unit tests green (TDD).
  • npm run build (nuxt generate, incl. fork-ts-checker) compiles clean; /diff route generates.
  • eslint clean on changed files.
  • Docker image build validated via a workflow_dispatch run of build-image on this branch (Node 24 / nginx 1.28).

🤖 Generated with Claude Code

mxhob1 added 4 commits June 4, 2026 02:03
…ng app build

ts-jest now uses tsconfig.jest.json (jest types) for specs; *.test.ts excluded from the app tsconfig so the nuxt build doesn't type-check them. Adds @types/jest.
… links

On the ?id= path the URL hash holds the AES key for the server-stored blob, not the diff payload. syncLabelsToUrl() ran when unzipCommitData set the pane labels after decryption and replaceState'd the hash with the gzipped payload, so refreshing/re-copying the link failed with 'We couldn't decrypt your diff.' buildLabelSyncUrl() now returns null on the ?id= path, leaving the key intact.
…on bar

Adds an A/B line-count display with a colour-coded net delta (b - a) to the diff action bar, computed reactively from the store payload (matches the Monaco gutter). Hidden under 640px.
Build stage node:22 -> node:24 (current LTS); production nginx 1.27.0 (old mainline) -> 1.28.3-alpine-slim (current stable, pinned). Loosen engines 22.x -> >=22 so the Node 24 Docker build and newer local runtimes don't emit EBADENGINE. Bump CI matrix node 20 (nears EOL) -> 22 (the supported floor). Kept --openssl-legacy-provider (webpack 4 / MD4 on OpenSSL 3) and documented why.
@mxhob1 mxhob1 merged commit 7daaf60 into develop Jun 3, 2026
1 check passed
@mxhob1 mxhob1 deleted the fix/encrypted-diff-link-and-line-counters branch June 3, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant