-
Notifications
You must be signed in to change notification settings - Fork 38
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
Improve offline support #176
Comments
Hey @marandaneto I noticed this got closed with #177. Wondering if you can provide any more context on how offline support is improved. Is the queue now cached on the file system? Is there any limitation to the number events that this queue can store or length of time that an app can be offline for? Thanks for working on this!! |
All events will be cached if the device is offline, there's a timer flushing the events to the network, and the timer is configurable via |
It is important to mention that for the queue to be persistent between sessions (e.g.: the app is used offline several times, being opened and closed, and at some point it is used online), the user must set the PostHog.posthog = posthog.init('your_key', {
api_host: 'https://us.i.posthog.com',
persistence: 'localStorage',
persistence_name: 'posthog-persistent-queue-or-the-name-you-prefer'
}) EDIT: I'm testing here and it seems like not even in this case the queue is persisted between sessions. @marandaneto am I right to understand that? I've opened #324 to discuss it further. |
Description
Context https://posthog.com/questions/offline-usage-1
It partially does. It persists the queue. The only thing is, that it doesn't:
this is nice to have since network connectivity callbacks only tell there's a cellphone signal or wifi connected but not necessarily the internet.
this is a must, if an app is offline first, and it's always offline, the queue will try to be flushed and will remove the items from the queue, but it will fail since there's no connection at all, that slice of the queue will be lost if not restored.
The text was updated successfully, but these errors were encountered: