Repository navigation
Conversation
ActivityKit drops updates whose content state encodes to more than 4 KB, without an error. Libre sensors report every minute, so the activity carried the 100-sample cap plus the prediction line: about 5.4 KB in JSON, against about 3 KB for a G7. Every update was dropped and the activity stayed on the empty placeholder, showing 0.0 and "Open the app to update the widget" (#2456). Send the chart at most one point per ~5 minutes, keeping the latest. The current value and delta still use every sample.
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.
Fixes the Live Activity staying on "Open the app to update the widget" with 0.0 glucose when using Libre sensors (#2456).
Cause
ActivityKit drops any update whose content state encodes to more than 4 KB, and doesn't report an error. Libre sensors report every minute, so the activity was sending the 100-sample cap plus the prediction line:
Every update was dropped, so only the placeholder activity created on foreground was ever shown. This matches the next-dev report in #2456 that it started right after switching from G7 to Libre 3+.
Change
The Live Activity chart now gets at most one point per ~5 minutes (4.5 min spacing, keeping the latest). Thinned Libre data comes to ~3.0 KB, the same as a G7. The current value and delta still use every sample.
Testing
The Loop scheme builds. The sizes come from encoding equivalent structures with JSONEncoder. Not yet tried on a phone with a Libre sensor.