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).
…not reach the transmitter
A tester pressed End Sensor on a transmitter with a near-dead battery. The
stop sat in the queue while every connection failed, the screen did not
change, and the session was never stopped.
- Commands can be queued with notifyIfUndelivered. Stop, start and
calibration are flagged.
- A flagged command still queued after 15 minutes raises "Transmitter not
responding"; one that fails to send, or expires unsent (a calibration
older than 5 minutes), raises "Request not sent" with command-specific
wording. Nothing is ever retried: a failed command is dropped and the
user decides whether to ask again. Calibrations in particular are never
re-sent.
- Settings shows a pending stop ("Stopping Sensor Session…" and a queued
note), turns it into a warning once delayed, and shows a warning with the
button restored after a failed stop or calibration.
- Alerts are also evaluated from fetchNewDataIfNeeded, so time-based ones
fire without a connection.
- Every enqueue is logged, not only ones that replace a queued command.
- Simulator: a relaunch resumes a running session instead of restarting
warm-up.
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.
Why
A tester pressed End Sensor on a transmitter with a near-dead battery. The stop sat in the queue while every connection failed, the settings screen didn't change, so they pressed it again (three times in the log). The session was never stopped, and nothing told them.
What
enqueue(_:notifyIfUndelivered:): commands can be flagged when the user is relying on them. Stop, start and calibration are flagged. The flag and the queue time are persisted with the queued command; entries saved by older builds read back as unflagged.fetchNewDataIfNeeded, so time-based alerts fire without a connection.Follow-ups in other PRs
enqueue, and clear the undelivered notice and in-flight command when passive mode is toggled.Screenshots
Testing
CommandQueuetests for flag persistence, the 15-minute threshold, a dequeued command never coming back, and a stale flagged calibration being reported rather than sent.🤖 Generated with Claude Code