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

Synchronization reliability on Android platform #341

Open
dyura opened this Issue Oct 9, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@dyura

dyura commented Oct 9, 2018

Hello!
It is regarding the synchronization in Android application after the device was off-line. "Notes" on Android is not using services. Not using services might be reasonable. However, without any service "Notes" cannot assure the synchronization after the device becomes again connected to the network. If we are intensively using an Android device, when being off-line, we have a good chance, that "Notes" will be killed by Android before synchronization can start. A service would be a correct solution, but avoiding too much extra work, I would suggest two different workarounds. First is very simple, just to set a reminder. When an update was done in offline mode, Notes can send notification, which will mean, that the content is not synchronized yet. It will remind to start "Notes" manually when network will be back.
The second workaround could be scheduled synchronization via "alarm manager".

Thanks,
Yury

@mobitar

This comment has been minimized.

Member

mobitar commented Oct 10, 2018

Hey @dyura, in this case, syncing would happen in two scenarios:

  1. Immediately when you open the app.
  2. If you are offline while the app is open, then come online while the app is open, it will not sync right away, but will sync within the next 30 second timer.

But if you are offline then come online, then open Standard Notes, it should sync right away. Are you noticing other behavior?

@dyura

This comment has been minimized.

dyura commented Oct 10, 2018

Hi ,Mo,
“it will not sync right away, but will sync within the next 30 second timer.” It is not always so. I am offline every day for about 1.5 hour, and I had an opportunity to observe. The statement “while the app is open” is ambiguous. If you mean, that after offline changes we will keep the application on the screen, that means not using other applications, then I agree. It is very unlikely that Android will kill the process. However, if after changes you will open another applications, then the picture is very different. Just reading offline messages might not affect Notes. But work with memory consuming applications, such as spreadsheets, word processors, pdf viewers, movie players, etc, will force Android to kill all inactive processes, and it is 100% that Notes will be killed while we are offline. Then when we come online, we have to keep in mind to start Notes again. Currently, if my offline changes are important, I set reminders to check later, if Notes were synchronized. That is why I suggest adding notifications to Notes.
Alarmmanager could be also useful, but it requires more logic.

Yury

@mobitar

This comment has been minimized.

Member

mobitar commented Oct 11, 2018

Oh I see. So you're saying that you might make important offline changes in the Android app, close the app, then, maybe later, you come on your Desktop app or something and expect to see your changes but don't? That's true, it wouldn't automatically sync your changes. We don't do any sort of background activity. But I can see why that can be useful. I'll keep this in mind. We use React Native, so however we build this needs to be cross-compatible with iOS, which makes this a little tricky out of the box.

@dyura

This comment has been minimized.

dyura commented Oct 12, 2018

@mobitar

This comment has been minimized.

Member

mobitar commented Oct 13, 2018

Got it, thanks. Will keep this in mind as we begin investigating working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment