fix(DB): Keep Loot-Filled Pumpkin emblem swap replay-safe - #493
Conversation
progression_80_1_hallows_end.sql swaps the pumpkin's Emblem of Frost row for Emblem of Valor with an UPDATE, but the down file only clears 49426, 49128 and 49126. On a realm running ReapplyUpdates the converted 40753 row survives, the replay re-inserts 49426, and the UPDATE then hits a duplicate key on item_loot_template (Entry, Item). The updater aborts on the failing file, so every file sorting after it is skipped, including progression_80_2_disables.sql. Ulduar and the 80_3 instances end up disabled again by progression_0_disables.sql on every restart. Clear 40753 along with the other rows so the swap can run again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe rollback SQL now removes item 40753 from ChangesHallow's End loot cleanup
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~2 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The migration replay fix is narrowly scoped and restores reliable progression processing after restarts. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Problem
On a realm with
ProgressionSystem.ReapplyUpdates = 1, Ulduar is disabled again after every restart, along with Onyxia's Lair, Trial of the Crusader and Trial of the Champion.The cause is a duplicate-key error in the Hallow's End loot swap added in #492:
progression_1_19_hallows_end_down.sqldeletes items49426, 49128, 49126from the Loot-Filled Pumpkin (54516) and re-inserts the Emblem of Frost row.progression_80_1_hallows_end.sqlthen runsUPDATE item_loot_template SET Item = 40753 WHERE Entry = 54516 AND Item = 49426.The first replay works. On the next one, the converted
40753row is still there because the down file does not clear it, so the UPDATE collides with the primary key(Entry, Item):The updater treats a failed file as fatal and stops, so every file sorting after
progression_80_1_hallows_end.sqlis skipped. That includesprogression_80_2_disables.sqlandprogression_80_3_disables.sql, which are the only files that lift the map disables for those instances.progression_0_disables.sqlsorts early and runs fine, so it re-inserts the Ulduar disable on every restart with nothing left to remove it.Observed on an affected world DB: 174
progression_*rows inupdates, ending atprogression_80_1_epic_gems_down.sql, with the next 23 files missing starting exactly atprogression_80_1_hallows_end.sql, and both40753and49426present on entry 54516.The Heart-Shaped Box swap in
progression_80_1_love_in_air.sqlis not affected: its down file deletes the whole entry rather than a list of items, so the converted row is cleared first.Fix
Add
40753to the DELETE inprogression_1_19_hallows_end_down.sqlso the slot is free when the swap runs again.Tests
Replayed every enabled bracket's SQL in filename order against a world DB inside a transaction:
disablesends with no row for map 603.🤖 Generated with Claude Code
Summary by CodeRabbit