-
Notifications
You must be signed in to change notification settings - Fork 5
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
Refactor the SDK to use the new HTTP event tracker #410
Conversation
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.
Amazingly simpler
Co-authored-by: Renan Oliveira <[email protected]>
commit:
|
Code Climate has analyzed commit 4dd7c1e and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 99.8% (-0.1% change). View more on Code Climate. |
Summary
This PR swaps out the WebSocket implementation with an HTTP-based one for tracking events.
I've also made a fix in their pull request that was uncovered when I changed the implementation.
We have a queue that stores events in the local store in case they cannot be delivered. When the SDK is initialized again, it attempts to deliver the pending events as the first task.
However, there were two issues:
PersistedQueue
implementation kept a copy of the state in memory to avoid re-parsing the JSON for every read/write operation. However, changing the behavior to have a single source of truth would cause one tab to override the other. Therefore, I refactored it by removing this optimization.Important
Before merging this PR, we need to make sure of two things:
Checklist