Skip to content

fix(backend): atomic & resumable content import - #403

Open
tolulopedd26 wants to merge 1 commit into
UnityChainxx:mainfrom
tolulopedd26:feat/tolulopedd26-atomic-content-import
Open

fix(backend): atomic & resumable content import#403
tolulopedd26 wants to merge 1 commit into
UnityChainxx:mainfrom
tolulopedd26:feat/tolulopedd26-atomic-content-import

Conversation

@tolulopedd26

Copy link
Copy Markdown

Closes #271

Run the puzzle migration inside a single DB transaction so a failure
mid-batch rolls back every row instead of leaving partial categories,
puzzles, dependencies, or rewards persisted.

- wrap migratePuzzles in dataSource.transaction via the shared manager
- abort + roll back the entire batch on any insertion error (e.g. an
  in-batch duplicate violating the unique (title, category) index)
- skip pre-existing rows so re-running the same upload is idempotent
- surface a rolledBack flag on MigrationResult and report zero inserts
  after a rollback (nothing was actually persisted)
- add rollback and restart unit tests

Closes UnityChainxx#271
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@tolulopedd26 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1][backend] Make content import atomic or resumable

1 participant