fix(sync): replay interrupted messages immediately

This commit is contained in:
Brent Perteet
2026-08-24 17:05:36 -05:00
parent 36f583169c
commit db2439c52e

View File

@@ -98,10 +98,12 @@ public sealed class SqliteOutboundStore : IOutboundStore
{
await _db.CreateTableAsync<OutboundMessage>();
// A process crash can leave rows in-flight after the broker accepted them but before
// the application ack was applied. Requeue them; pointId makes the replay idempotent.
// the application ack was applied. Requeue them for immediate replay; pointId makes
// the replay idempotent. A zero due-time also keeps recovery independent of whichever
// clock implementation the sync engine uses.
await _db.ExecuteAsync(
"UPDATE outbound SET Status = ?, NextAttemptUnixMs = ? WHERE Status = ?",
(int)OutboundStatus.Pending, DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
(int)OutboundStatus.Pending, 0,
(int)OutboundStatus.InFlight);
}