dekkerglen / CubeCobra

An open source web application for building, managing, and playtesting Magic the Gathering cubes.
https://www.cubecobra.com
Apache License 2.0
193 stars 120 forks source link

Changelog history is not guaranteed to be generated for an update #2459

Open dsoskey opened 4 months ago

dsoskey commented 4 months ago

Describe the bug In the cube commit route, Cobra writes updates to DB first, then writes the changelog. If the server fails between these two events, Cobra has no way to reconcile that missing history

To Reproduce Steps to reproduce the behavior:

  1. Call /cube/soskgy/commit with a change et
  2. Kill server after this line runs but before the next one.
  3. See updated cube with missing history

Expected behavior I want the changelog to be the ultimate source of truth for the current state of the cube. Once a single update has a missed history it becomes much harder to rebuild the state of the cube from the existing data.