Files
ScadaBridge/tests
Joseph Doherty 8b64d1ec9c fix(site-runtime): move synchronous SQLite work off the Akka dispatcher (SRT-5, WP6 task 6.1)
Follows the InstanceActor static-override pattern: the storage call runs in
Task.Run, flushes chain on a persist-tail task so batches stay ordered, and
reads PipeTo(Self).

- NativeAlarmActor: FlushDirtyUpserts runs ApplyNativeAlarmChangesAsync on an
  ordered persist tail; the PreStart rehydration read runs in Task.Run and
  seeds the tail, so no flush can commit before the read.
- InstanceActor: the ungated PreStart override read runs in Task.Run; the
  List-override normalising re-persist joins the static-override persist tail
  (off-dispatcher and ordered behind/before batched flushes).

Evidence (NativeAlarmActorTests.Flush_BlockedOnWriteLock_DoesNotBlockTheActorThread,
another connection holding BEGIN IMMEDIATE for ~1.6 s, busy_timeout 5 s):
  before: the next transition's emit stalled until the lock was released
          (ExpectMsg 500 ms timed out; actor thread parked in the flush)
  after:  next transition emitted while the flush waits; both rows commit
          once the lock is released.
2026-12-03 09:41:03 -05:00
..