-
Notifications
You must be signed in to change notification settings - Fork 397
Allow critical event log to be exported with mixed 3.2.x and 3.3 formats #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LOOP-4688 DIY Sync
|
@ps2 Please respond. This solves the problem for test phones that have had main built over dev. |
LoopKit/JSONStreamEncoder.swift
Outdated
| } catch { | ||
| // Log the error and insert a placeholder or error message in the JSON | ||
| print("Failed to encode value: \(value) with error: \(error.localizedDescription)") | ||
| let errorInfo = "{\"error\": \"Failed to encode item due to: \(error.localizedDescription)\"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the value here? I'm wondering what was actually failing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tagged @bjorkert to make sure he sees this.
This bug has been present since before Oct 2023.
No one is aware that they have a problem until they need to get help and realize they cannot issue a critical event log. Most people don't build dev and then return to main, but it can happen. The error is reproducible if you build main (3.2.x) onto a phone that previously had dev (3.3.0) and have loop run a couple of cycles and store data. Then you can no longer issue the critical event log with main or if you build dev again.
IMO, this work-around is good enough and can be patched later if a better solution is found. I have tested that it works on test phones.
|
I will test this modification and report back. |
|
Test Phone:
Test:
Xcode Debug Log with new test: Critical Event Log results will be in next comment. |
|
The error is found in the DosingDecision.json for today's date. Both the full zip and the DosingDecison.json for today are included below. |
When switching from version 3.3 or later code to an earlier version such as 3.2.x code, the Critical Event Log can no longer be exported (from with 3.2.x or 3.3 code). See Loop Issue 2081: Export Critical Log fails
This work-around allows the export to continue past errors.
Test 1
Examine the Critical Event Log for the current day: