feat(api): auditable map revisions with deltas + periodic snapshots (#12) - #347
Open
Aduersarius wants to merge 1 commit into
Open
feat(api): auditable map revisions with deltas + periodic snapshots (#12)#347Aduersarius wants to merge 1 commit into
Aduersarius wants to merge 1 commit into
Conversation
…Bitcoindefi#12) Store compact tile deltas for paint/clear/publish/discard/revert with a full snapshot every 20 revisions. Adds undo/redo/rollback/diff admin endpoints and requiresRepublish when undoing a published change.
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
Implements OpenAO #12 with the issue's recommended deltas + periodic snapshots design (snapshot every 20 revisions), plus undo/redo, arbitrary rollback, readable diffs, and
requiresRepublishwhen undoing a publish.Closes #12
Design
game_map_revisions/game_map_revision_headsbefore/afterper changed coord)undoinverts the current head delta and setsrequiresRepublishif the undone op waspublish(published world is not silently changed without an explicit republish)redo/rollback/diffrebuild via nearest snapshot + forward deltasAdmin API
GET /admin/game-data/maps/:mapNum/revisionsGET /admin/game-data/maps/:mapNum/revisions/diff?from=&to=GET /admin/game-data/maps/:mapNum/revisions/:revisionIdPOST /admin/game-data/maps/:mapNum/undoPOST /admin/game-data/maps/:mapNum/redoPOST /admin/game-data/maps/:mapNum/rollback/:revisionIdDifferentiation vs #73
#73 stores full before/after snapshots on every operation inside
worldBuilder.ts. This PR follows the issue suggestion: lightweight deltas + periodic snapshots, isolated ingameMapRevisions.ts, so undo is natural and storage stays bounded for long edit sessions.Test plan
api/src/tests/mapRevisions.unit.test.ts)requiresRepublish: trueand does not leave draft as silently liveGrantFox OpenAO bounty submission for #12.