Skip to content

fix(sync): preserve prototype-named canonical payload keys - #4463

Open
rudycelekli wants to merge 2 commits into
thedotmack:mainfrom
rudycelekli:campaign/cm-canonical-proto-20261005
Open

rudycelekli wants to merge 2 commits into
thedotmack:mainfrom
rudycelekli:campaign/cm-canonical-proto-20261005

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

Summary

Canonical serialization assigned arbitrary JSON keys into a regular object. A metadata key named __proto__ was silently dropped, so distinct payloads produced the same canonical bytes and hash. Build the normalized object without a prototype so JSON keys survive recursively.

Verification

  • Bun 1.4.2: tests/worker/sync/canonical-prototype-keys.test.ts tests/worker/sync/canonical-content.test.ts
  • 2 regressions fail before; 8 tests / 202 assertions pass after, including shared canonical byte/hash vectors.
  • Owned temporary fixtures; no installed plugin or user memory was accessed.
  • Source and regression tests only; generated release bundles are unchanged. Hosted CI is not yet reported for this unpublished branch.

AI assistance was used to investigate, implement and verify this change.

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Fixes payload serialization to preserve special property names.

No outstanding findings block merging.

Summary

The client and both sync servers now preserve own JSON keys named __proto__ during canonical serialization. The previously reported server mismatch is fixed.

Reviews (2) · Last reviewed commit: "fix(sync): align server canonicalizers f..."

Comment thread src/services/sync/CanonicalContent.ts
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>

This branch has not been deployed

No deployments
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