Pebblekit buffering improvements#130
Closed
matejdro wants to merge 2 commits intocoredevices:masterfrom
Closed
Conversation
Contributor
Author
|
This worked well to fix the app reopen issue, but it does not resolve |
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.
This PR attempts to address two issues with the current buffering system:
If the user closes the app and then quickly reopens it within 2.5 seconds, app will still receive stale AppMessages. I have attempted to fix this by draining all messages on the AppRunStateStop command. I think AppRunStateStop always comes last, so this should not cause major issues? Or is the out-of-order also possible here?
message timeout applied to all messages, not just the too-early ones. This meant that if the downstream app is taking its sweet time processing the message, we might drop the messages just because the consumer is too slow. I have changed it so we only check it against the app start time , not the current time. So only messages sent way before app started are dropped.
Now, the issue with this PR is that I could not really test it. As part of the PT2 Alpha program, I was told to keep the official Pebble app installed and running for a longer time to gather logs for some issues that I'm still experiencing. So I cannot replace it with the test version temporarily. We can keep this PR open until I have the chance to test it or if you feel the code is okay, we can merge it.