Repository navigation
fix(apps): close review gaps in the legacy feature handoff journal - #561
Merged
Merged
Conversation
Address the CodeRabbit review of #560. None of the gaps was reachable yet because no domain source is registered. - Refuse the exclusive domain lock outside read committed and inside a transaction that already holds a writer's shared lock, so an export always reads after every fenced writer committed. - Hold shared locks on every domain while the preview reads owners and source inspections, so a commit cannot land between both reads. - Validate the serialized part text as well, treat throwing getters or toJSON hooks as invalid parts, and keep fire-and-forget rejections handled. - Settle every accepted part before begin returns or rethrows. - Document that retire may run again after a rolled-back commit. - Scope test cleanup to rows the test created, check every ciphertext, prove the export waits behind a running writer and settle all transactions before cleanup. Refs #457 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 35 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 24, 2026
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.
Summary
This PR fixes the eleven CodeRabbit findings that were still open when #560 merged. None of them was reachable yet, because no legacy feature source is registered. Each one would have mattered once the Monitoring extraction plugs in its source.
Lock protocol
lockLegacyFeatureDomain, which backsbegin,commitandabort, now refuses two kinds of transaction:inspectLegacyFeaturesInTransactiontakes shared locks on all domains before it reads the owners and runs the source inspections. A handoff therefore cannot commit between the two reads, and the preview never pairsowner: platformwith retired state.Export
toJSONcannot store values outside the contract. A throwing getter or hook counts as an invalid part and is recorded as the failure, even if the source swallows it.beginstill rejects.beginsettles every accepted part in afinallyblock before it returns or rethrows. No insert outlives the call on an abandoned transaction.Docs
retiredocuments that it can run again after a rolled-back commit, and that it must make its changes through the supplied transaction.Tests
pg_locksand asserts that the export has not started. It also proves that the preview waits for the handoff.finallysettles all transactions before it restores the key and removes fixtures.toJSON;Related issue
Refs #457. Follow-up to #560.
Type of change
Testing
web/src/tests/server/LegacyHandoff/against PostgreSQL 18: 6 pass. The handoff modules keep 100% line coverage.web/src/server/LegacyHandoffcode, the new tests fail in exactly the reported gaps:Checklist
Breaking changes
None. The handoff functions now reject repeatable read and serializable transactions, and a handoff inside a writer's own transaction. No caller exists yet.
Screenshots
None.
🤖 Generated with Claude Code