Skip to content
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

task(persistence): implement persisting sessions when delivery fails #509

Merged
merged 15 commits into from
Feb 21, 2022

Conversation

rich-bugsnag
Copy link
Contributor

@rich-bugsnag rich-bugsnag commented Feb 16, 2022

Goal

implement persisting sessions when delivery fails

Design

The flow is as follows.
1: When a session is recorded it gets added to a list of pending session payloads in memory
2: If the session is sent successfully then the pending session is removed
3: If the sessio fails to send it is written to disk, then on next startup or when the app comes back into focus we try and send it again

Changeset

  • Added FileManager class
  • Added config value MaxPersistedSessions and pass the value through to Android and Cocoa
  • Display MaxPersistedSessions in the bugsnag config unity window
  • Try sending cached payloads on launch and when app regains focus

Testing

Added CI tests for Windows and WebGL

@rich-bugsnag rich-bugsnag self-assigned this Feb 16, 2022
@rich-bugsnag rich-bugsnag marked this pull request as ready for review February 16, 2022 14:02
Copy link
Contributor

@nickdowell nickdowell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was persisting sessions prior to sending a deliberate design decision?

We not too long ago changed the Cocoa notifier to only persist sessions if sending failed, in order to reduce disk activity...

@rich-bugsnag
Copy link
Contributor Author

Was persisting sessions prior to sending a deliberate design decision?

We not too long ago changed the Cocoa notifier to only persist sessions if sending failed, in order to reduce disk activity...

Good thinking, i changed to so that it now has a list of pending sessions saved in memory, and it only writes them to disk if they fail to send 👍

@rich-bugsnag rich-bugsnag merged commit 5ecf469 into next Feb 21, 2022
@rich-bugsnag rich-bugsnag deleted the 6596-persit-sessions branch February 21, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants