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

Add support for offline storage of errors to Raygun4Net Core #530

Merged
merged 21 commits into from
Jun 7, 2024

Conversation

xenolightning
Copy link
Contributor

@xenolightning xenolightning commented May 14, 2024

Add offline storage of crash reports to Raygun4Net

  • This adds a new class OfflineStoreBase
  • This class can be extended to support any sort of storage of errors, and any custom logic
  • We have 2 default store implementations, FileSystem and Local App Data
  • New interface IBackgroundSendStrategy which is used to determine how often the store should attempt to send it's errors
  • By default there is a timer based strategy, which uses a background timer to initiate a check at certain intervals

All these classes are designed to be able to be updated/changed by users if they need specific functionality

MAUI will have it's own store implementation

This is an early implementation to allow for early feedback and suggestions

It is intended that the storage is treated as a singleton. There are default implementations in the net core project, but for other providers such as MAUI there should be another implementation.

There is also a singleton background sender, which has an internal timer.

Due to the way RaygunClientBase isn't exactly a singleton, we need to loosely couple the actual send method using a delegate (gross)

@xenolightning
Copy link
Contributor Author

@phillip-haydon this is mostly ready for review.

Can review the approach, and the linkage to the client for now

There is a singleton background worker, and it is wired up to a cache - which should also be a singleton.

The clients (not a singleton yet) can then use the offline store to put failed crash reports, to be picked up by the background worker at a later date.

If it fails to send, then it does not remove the cached error from the disk

Copy link

@PanosNB PanosNB left a comment

Choose a reason for hiding this comment

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

Lot's of good work! Some questions on my end

Copy link
Contributor Author

@xenolightning xenolightning left a comment

Choose a reason for hiding this comment

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

Tagged phill to review the public api surface in specific areas

phillip-haydon
phillip-haydon previously approved these changes May 28, 2024
Copy link
Contributor

@phillip-haydon phillip-haydon left a comment

Choose a reason for hiding this comment

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

Only 1 comment..

Mindscape.Raygun4Net.NetCore.Common/RaygunClientBase.cs Outdated Show resolved Hide resolved
@xenolightning xenolightning force-pushed the sean/offline-storage branch 2 times, most recently from 1e3fa0b to ca579cf Compare May 29, 2024 19:22
@xenolightning xenolightning changed the title WIP - Add support for offline storage of errors to Raygun4Net Core Add support for offline storage of errors to Raygun4Net Core Jun 3, 2024
PanosNB
PanosNB previously approved these changes Jun 4, 2024
Copy link

@PanosNB PanosNB left a comment

Choose a reason for hiding this comment

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

All good! A couple of non-blocking comments

Copy link
Contributor

@phillip-haydon phillip-haydon left a comment

Choose a reason for hiding this comment

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

😠

Copy link

@PanosNB PanosNB left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@xenolightning xenolightning requested review from phillip-haydon and removed request for phillip-haydon June 5, 2024 20:51
@xenolightning xenolightning merged commit bebaf89 into master Jun 7, 2024
1 check passed
@xenolightning xenolightning deleted the sean/offline-storage branch June 7, 2024 02:01
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.

4 participants