Fix FAT Clock Sync control and immediate TRUE evidence - #150
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfe3354868
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Devices.CollectionChanged -= ClockSyncDevices_CollectionChanged; | ||
| foreach (var device in Devices) | ||
| device.PropertyChanged -= ClockSyncDevice_PropertyChanged; |
There was a problem hiding this comment.
Guard queued reconciles when Clock Sync is disabled
If IsConnected changes on a runtime thread just before these handlers are removed, ClockSyncDevice_PropertyChanged may already be enqueuing ScheduleClockSyncReconcile on the dispatcher. While this method awaits StopAsync, that queued reconcile can wait behind _clockSyncIntegrationGate and then restart the SNTP service after the stop completes, because neither scheduling nor EnsureClockSyncForDeviceAsync checks _clockSyncEnabled. In that race, the unchecked control continues serving and broadcasting time; recheck the enabled state after dispatching and after acquiring the gate, or cancel pending reconciles.
Useful? React with 👍 / 👎.
…163) Preserve #150 immediate TRUE-edge evidence priority while retaining P0 bounded 64-snapshot / 4-ms drain yielding. First drain dispatch uses DataBind; backlog continuations yield at Background. Validated on exact current-main integration head with IO FAT, deterministic SV, and full Windows build/test/package gates.
What changed
BackgroundtoDataBindso a TRUE edge is evaluated and its ON evidence is bound before the next UI render instead of being delayed until a later FALSE edge under busy live monitoring.Audit finding
The transition evaluator already captures ON evidence on the FALSE→TRUE edge. The delay was downstream: the FAT session controller drain was scheduled through WPF at
DispatcherPriority.Background, allowing live UI/monitor traffic to postpone evidence processing. The timestamp columns continue to display actual relay timestamps only; this patch does not substitute laptop time for missing relaytvalues.Safety invariants