Skip to content

Errors on Offline app #973

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

Closed
wants to merge 1 commit into from
Closed

Errors on Offline app #973

wants to merge 1 commit into from

Conversation

seromenho
Copy link

@seromenho seromenho commented Jun 8, 2017

This is my proposal to #279. Any thoughts/suggestions to improve or make it different are welcome.
Thanks.

Description

When calling _makeRequest(or custom transport) set the onError function to store the event if we have the feature enabled.
This means the feature can also be used on the custom transport if we use the passed onError.
The queue is processed once we initialise it or on the online event or a custom one set with onlineEventName.
Processing the queue means call again _sendProcessedPayload with the stored error data.

New options

  • allowOfflineStorage - Boolean false by default.
  • onlineEventName- Event name if you want to specify some other than the online(default) to trigger the process queue while still on the app. Eg: You don't use some other event on your app to say you have connection.

TODO

If this works for you I'm missing documentation and tests.

@benvinegar
Copy link
Contributor

Hey, so our feeling is that this should be a plugin, which we'd be happy to make happen by translating this patch to a plugin form.

@seromenho
Copy link
Author

Hey,
I'm happy with that.
Let me know if I can help.
Thank you.

@MaxBittker MaxBittker self-assigned this Jul 11, 2017
@kamilogorek
Copy link
Contributor

@seromenho still interested in tackling this issue?

@seromenho
Copy link
Author

@kamilogorek yes. Let me know what I can do to help.
Thank you.

@kamilogorek
Copy link
Contributor

Your implementation itself is very good, the thing that has to be done is extracting it to a separate file, wrapping it in exported function and hooking into Raven using addPlugin method https://github.com/getsentry/raven-js/blob/master/src/raven.js#L507-L516

The best implementation you can base on is React Native plugin https://github.com/getsentry/raven-js/blob/master/plugins/react-native.js as it shows how to add dataCallback to store the data before sending, how to drain those events and how to register a plugin.

Also allowOfflineStorage won't be necessary anymore, as every plugin is opt-in.

Let me know if you need any more pointers or feedback.

Cheers!

@seromenho
Copy link
Author

Closing this one. Followed suggestions and created a plugin from this.

@seromenho seromenho closed this Dec 4, 2017
@seromenho seromenho mentioned this pull request Dec 4, 2017
@CombeeMike
Copy link

Is this plugin somewhere publicly available?

@squallstar
Copy link

@CombeeMike #1165

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.

6 participants