Diagnose and skip rogue Nightscout profile records#635
Open
Conversation
Profile fetch now uses /api/v1/profiles?count=1 with find[startDate][$lte]=now, so future-dated records can no longer block the active profile. Adds a "Run diagnostics" button in the Remote Settings Debug section that fetches 14 days of profile history and surfaces three failure modes: - Bundle ID mismatch when Loop and Trio share a Nightscout - Alternating device tokens from multiple installations - Future-dated profile records left over from a wrong-clock uploader The bouncing-tokens check compresses consecutive same-token runs and only warns on actual token alternation, not normal token rotation.
Member
Author
Member
Author
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.


Summary
/profile/currentto/api/v1/profiles?count=1&find[startDate][$lte]=now, so future-dated records can no longer hide the active profile./profile/currentonly sorts bystartDatedesc and ignores whether that date is in the past or future, which makes a single rogue upload (e.g. a phone with the wrong system clock) keep winning indefinitely. Thefind[]filter is the same query syntax already used for treatments, sage/iage/cage, BG data, and stats.bundleIdentifier(Loop populatesloopSettings.bundleIdentifier, Trio populates the top-level field) againstStorage.shared.device.value.a→b→cstays silent).ScrollViewReaderanchored to the diagnostics block).NightscoutUtils.executeRequest/parseDate, thefind[]parameter convention,dateTimeUtils.formattedDate(from:), the orangeexclamationmark.trianglewarning idiom fromImportExportSettingsView. No new abstractions.