feat(hunts): implement versioning for hunt edits with restore functio… - #1213
Merged
Samuel1-ona merged 1 commit intoAug 27, 2026
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.
Closes #1195
Add Hunt Version History and Restore
Summary
Adds durable version history for creator hunt edits and allows creators to restore previous versions.
Each submitted hunt snapshot is stored in PostgreSQL with a per-hunt version number, creator address, and timestamp. Restoring a version creates a new version instead of overwriting history.
Acceptance Criteria
PATCH /api/v1/hunts/[id]POST /api/v1/hunts/[id]/versions/[version]/restoreAPI Changes
PATCH /api/v1/hunts/[id]actorAddress.GET /api/v1/hunts/[id]/versionsPOST /api/v1/hunts/[id]/versions/[version]/restorePersistence
Added the
hunt_versionsPostgreSQL table with:Version numbering uses PostgreSQL advisory locks to prevent duplicate versions during concurrent edits.
On-chain hunt creation records remain immutable. This feature versions the mutable application snapshot.
Documentation
Updated:
docs/api.mddocs/persistence-strategy.mdThe documented retention period is 90 days. Expired versions are excluded from reads and removed during subsequent writes.
Validation
git diff --check: passedtscis unavailable in the current environmentvitestis unavailable in the current environment