rollbar / rollbar-flutter

Rollbar for Dart and Flutter
https://docs.rollbar.com/docs/flutter
MIT License
21 stars 27 forks source link

More robust HTTP error handling #84

Closed matux closed 1 year ago

matux commented 1 year ago

Description of the change

This PR greatly improves how we handle corner cases and unexpected states when posting occurrences, and how we deal with persistence.

This should take care of all 3 issues listed in this PR.

This is an integral part of the upcoming 1.1.0 version.

Reviewing

CI may fail since it ignores our depency overrides and tries to compile against the library currently published, this is on the to-do list.

Type of change

Related issues

Checklists

Development

Code review

matux commented 1 year ago

@cyrusradfar Agreed, rate limiting is an important next step. I've already thought how to implement it by turning the internal pipeline (from notification to http transport) into a stream of data over time, this is gonna be fun.

Regarding server errors, right now we're handling 429 (Too many requests) and 5xx by suspending transactions for at least 30 seconds which was how it was originally implemented before I came in.

Client errors 413 (Payload Too Large) and 422 (Unprocessable Entity) discard the payload altogether (with a log) to avoid repeatedly sending payloads that may be incorrectly formatted due to a bug.

cyrusradfar commented 1 year ago

Appreciate that, thanks for the response.