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

offline #2

Closed
flutter-painter opened this issue Jul 21, 2023 · 11 comments
Closed

offline #2

flutter-painter opened this issue Jul 21, 2023 · 11 comments

Comments

@flutter-painter
Copy link

How does the SDK deal with offline devices ?
Does it check if the device is offline before sending events ?
Does it store them until a steady connexion is available ?

@goenning
Copy link
Member

Not yet, but that's the plan for the SDK before it gets to 1.0. The current version will lose events if connectivity is not available.

I'm working on adding batch events on the backend, and once that's implemented, then the SDKs could store events in memory and batch send them on an interval until there's connectivity.

@flutter-painter
Copy link
Author

Good news !
Out of curiosity from a humble Dart writer dealing with users allergic to connectivity ;
Will the SDK check device connectivity before attempting to send data ?
Coming from flutter I assumed implementation would be specific for each OS..

@goenning
Copy link
Member

Our SDK doesn't explicitly check for that, not sure about the underlying OS though.

Why do you say they allergic to connectivity? Form my experience if you go offline there are very few apps that actually work, in most cases people will have constant internet connection.

@flutter-painter
Copy link
Author

flutter-painter commented Jul 22, 2023 via email

@goenning
Copy link
Member

You're right, my comment was based on my own bubble, which is not very representative!

Would you like to contribute with Offline support for the Flutter SDK?

@flutter-painter
Copy link
Author

Sure ! It would be useful to write connectivity tests,
Will do it slowly, by the end of the summer

@goenning
Copy link
Member

Awesome, great to have you onboard. There's no rush at all as I still need to work on the batch event ingestion api.

It'll probably be something like:

POST /api/v0/events (instead of /api/v0/event for a single event)
[
 { event1 },
 { event2 }
]

And with regards to the SDK, I was thinking of when trackEvent is called, it would simply enqueue it in memory and then dispatch the list of in-memory events every X seconds if there's internet connectivity

@rafagazani
Copy link

What are you thinking for offline persistence? sqlite3? file?

@flutter-painter
Copy link
Author

SEMBAST, there is already a PR : #6
You could also plug SQLite3 or any kind of db on it, it is modular.
But we left it at that because goenning asked additional rework which required a lot of redesign,
You could fork from the PR if needed though, it works for me in production smoothly

@cristipufu
Copy link
Member

Hi @rafagazani, @flutter-painter, we merged #8 and release version 0.4.0. Give it a try and let us know how it goes 😸

@flutter-painter
Copy link
Author

This is great news ! Thank you for the heads up I will try and likely switch to it :)

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

No branches or pull requests

4 participants