Repository navigation
Conversation
Tidepool rejects a datum whose payload is over 4 KB of JSON, and with it the whole upload. Loop retries a failed exercise upload without moving on, so one long workout with many lap or segment events would stop all later workouts from reaching Tidepool. The payload now drops detail until it fits: first the events other than pause and resume, then the sub-activities, then the remaining events, then the HealthKit metadata. The activity type code and heart rate summary always stay.
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.
Tidepool rejects a datum whose
payloadis over 4 KB of JSON (tidepool-org/platformmetadata/metadata.go), and with it the whole upload (datasets_data_create.goreturns 400). Loop retries a failed exercise upload without moving on, so one long workout with many lap or segment events would stop every later workout from reaching Tidepool.The workout payload now drops detail until it fits:
The activity type code and the heart rate summary always stay. The limit used is 3800 bytes, leaving room for small differences between the app's JSON encoding and the server's.
Follows #48.
Testing:
StoredWorkoutDatumTests: a 2 h run with 120 segment events plus a pause/resume pair, and a workout with 5 KB of third-party metadata. Both fail without the fix.