FACTUAL ACTIVITY RECORD · An activity record based on work that took place
Synchronizing immediately after connecting a Thread
Closing the Room-assignment race with one shared in-flight synchronization
Purpose
After a connection setting was applied, the root Thread did not exist in the database until the next 30-second synchronization completed. Assigning it to a Room during that gap failed even though configuration and synchronization appeared to be one continuous operation to the administrator.
The goal was to synchronize immediately after applying the connection, avoid duplicate App Server reads and outbox delivery when periodic synchronization overlaps, and expose the result before Room assignment.
Implementation
command entry gained a synchronize function that shares the active synchronization Promise. Post-apply and 30-second periodic processing use the same entry point; if synchronization is already running, they await that in-flight operation instead of starting another.
In synchronization-control service, sync-target-apply calls synchronizeNow after applying configuration. Accepted, deferred, and failed outcomes are written as bounded events. A failed initial synchronization does not discard valid connection settings and remains eligible for periodic retry.
administration application refreshes Connector status after apply and displays the latest result. When it is not accepted, the interface directs the administrator to inspect and retry before assigning the Thread to a Room.
synchronization-control service was updated to verify that apply itself collects the selected root without an extra explicit synchronization call and exposes the result through status.
Rendering diagram…
What was confirmed
Verification results
Before the correction, the measured gap between apply and the next periodic synchronization caused Room assignment during that interval to fail.
After the correction, the updated Connector showed one connection setting, an accepted initial synchronization, and no pending outbox item.
Five targeted TypeScript tests, 21 Swift tests, the specification audit, and the diff check passed.
At the cutoff, immediate post-apply synchronization and result display were applied to the target, allowing the Room-assignment prerequisite to be established without waiting for the periodic cycle.
Basis for completion
The work was complete when post-apply synchronization shared the periodic in-flight operation, an actual root Thread was stored with an accepted result, and the status display and targeted tests confirmed the behavior.