Repository navigation
feat(evault): rollbackMetaEnvelope and per-version authors - #1176
Merged
Merged
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
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.
What
This follows up #1175. It adds what the new undo platform needs to restore history exactly and to show who changed what.
rollbackMetaEnvelope(id, version)restores an earlier version by writing it as a new version. History only grows, the version number keeps increasing, and a rollback can itself be rolled back.updateMetaEnvelope, which patches, the payload is replaced exactly. Fields the target version didn't have are pruned, not deleted. Envelope ids stay stable for fields that survive.fieldsJson), so values such as dates come back with their original type. Versions written before this change fall back to their JSON payload.includePruned), the same as for its history.VERSION_IS_DELETE), and so is an unknown version (VERSION_NOT_FOUND).updateevent, orcreatewhen a record is revived, plus an operation-log entry./logsentry now recordsauthor: the user the platform said it acted for, taken fromX-ON-BEHALF-OFor a wallet-signed token. It sits alongside the requesting platform.MetaEnvelopeVersionalso exposesrestoredFromVersion.Testing
evault-coreunit + integration: 293/293 pass. New coverage:X-ON-BEHALF-OFreaching both the history and/logstsc --noEmitis clean.