[Part 3/6] fix(session): notification routing, sensorEnd on user stop, expiry guard, discovery timeout - #3
Open
ETolboom wants to merge 4 commits into
Conversation
OSLog.log handed the [CVarArg] array to os_log for 6+ arguments, which reads garbage pointers for each %@ and segfaults in _os_log_fmt_flatten_object_impl. The seven-argument "Backfill acknowledged" line hit this on every backfill, crash-looping the app. The fallback now asserts in debug and logs the pre-rendered line as a single argument in release. The backfill ack line is collapsed to one argument.
…matrix + bump minimum target to iOS 17.6
…ensor work in the simulator Extract the pending-command logic into a pure CommandQueue value type (supersede-on-enqueue, 5-minute stale-calibration drop, raw-value persistence round-trip) with unit tests, and mirror didComplete into enqueue on the simulator, where no link will ever drain the queue. Also: stop simulated readings once no session is active, and mark Locked.mutate @discardableResult (both copies).
…ard, discovery timeout PeripheralManager.didUpdateValueFor: bind the condition's characteristic and compare with == instead of shadowing the parameter (any characteristic's update could satisfy a pending command's condition), and forward unclaimed notifications to the delegate even while a command is in flight (backfill frames were dropped mid-command). didComplete(.stopSensor): emit a .sensorEnd persisted event before clearing the session dates; the simulator drain path mirrors it. transmitterExpirationDate stays nil until the first version read: the fallback lifetime is a guess and a 180-day Anubis would alert as expired at day 90. Service discovery timeout 2s -> 10s. Battery re-arm reads the persisted state.lastBatteryReadDate instead of a transient ivar that was nil after every relaunch. UInt16(clamping:) for the persisted expiry-days Int fallback, matching G6CGMManagerState.
ETolboom
force-pushed
the
feat/transmitter-session-fixes
branch
from
September 29, 2026 10:57
1138015 to
7762e90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five small correctness fixes from DexKit's G6 stack (running there with on-device testers, no reported issues):
PeripheralManager.didUpdateValueFor): the condition match shadowed thecharacteristicparameter, so any characteristic's update could satisfy a pending command; and unclaimed notifications (backfill frames) were dropped while a command was in flight..sensorEndevent when the user stops a session (simulator drain mirrors it).transmitterExpirationDatestays nil until the first version read — a 180-day Anubis would alert as expired at day 90 against the fallback.state.lastBatteryReadDate;UInt16(clamping:)on the persisted expiry-days fallback.Stacked on #2; only the top commit is new.
Testing
swift test: 80 tests passing.