Files
sure/test
Guillem Arias Fauste ab14944a9f fix(sync): guard finalization against externally-staled syncs (#2680)
A sync marked stale by SyncCleanerJob while its job is still running
hits two lost-update paths when that job finishes:

- success path: finalize skipped the status transition but still ran
  perform_post_sync, re-applying transfer matching, rules, and
  broadcasts for a sync the system had already written off
- failure path: the rescue's unguarded fail! silently overwrote the
  terminal stale status with failed (the in-memory record still read
  syncing, so the AASM guard never fired)

Fix: re-check state under a row lock (with_lock reloads) before
failing, and skip post-sync for stale syncs in finalize. Post-sync
still runs for failed syncs — that behavior is intentional and
covered by existing tests.
2026-07-14 19:15:09 +02:00
..
2024-02-02 09:05:04 -06:00
2025-11-17 21:51:37 +01:00