Repository navigation
fix: carry finalized site mutation authority - #195
Merged
Merged
Conversation
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
A media-bound page can stop before its database write because the native operation marker round-trips through PHP’s associative JSON decoder. Empty objects in the pending intent body become arrays, so the full marker no longer matches the confirmed JavaScript authority even though the final block content is valid.
Solution
After the existing compile gates finish, page and synced-pattern mutations carry their compiled desired state and mutation metadata. The four compile-only fields are omitted from that final mutation authority.
src/site/apply.tssrc/site/apply.tsapplySiteDiff
+20 −6 · 2 files · no public API change
Testing & verification
Reviewed revision:
b02f962a7f2a33dea8de5c79c73505599bd3f88c· Environment: Node 22.23.1; local WordPress 7.1 / PHP 8.4.26 on OrbStack.npm test -- dev/test/site-apply.test.ts dev/test/site-media.test.ts dev/test/site-media-import.test.ts dev/test/site-patterns.test.ts: 63 passed.npm run typecheck,npm run build,npm run check:private,git diff --check: passed.Not verified: live synced-pattern finalization with this exact empty-object shape; covered by the shared code path and focused pattern suite. Required CI passed on this exact revision: Node 22.13.0 and 24.0.0 verification/packed-consumer checks, package boundary, WordPress 7.1 native proof and scope classification (run 38306092487). Both advisors found no blocking defect in the bounded source/recovery review; they did not independently replay WordPress.
Risk / rollout
No authority check is weakened. Final mutations use their complete compiled state; pending compilation input remains in the confirmed plan. No automatic recovery is added for existing failed journals. Older interrupted journals carrying these compile-only fields are not migrated and can still refuse; completed receipt replay keeps its existing exact checks.
Detection: a marker mismatch still refuses the operation. Rollback: revert this commit; existing failed journals continue to require explicit operator reconciliation.