Files
sure/app/models
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
..
2025-03-28 13:08:22 -04:00
2026-03-25 17:47:04 +01:00
2026-03-25 10:50:23 +01:00
2024-02-02 09:05:04 -06:00
2026-03-25 10:50:23 +01:00
2026-03-25 10:50:23 +01:00
2024-10-18 11:26:58 -05:00
2026-01-23 22:05:28 +01:00
2024-08-23 09:33:42 -04:00
2025-11-01 09:12:42 +01:00
2026-01-23 22:05:28 +01:00
2024-05-23 08:09:33 -04:00
2025-03-28 13:08:22 -04:00