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

[Bug]: Android does not sync #1416

Open
ggrensteiner opened this issue Dec 22, 2024 · 5 comments
Open

[Bug]: Android does not sync #1416

ggrensteiner opened this issue Dec 22, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ggrensteiner
Copy link

What was the Problem?

When listening to an audiobook on android the listening time does not sync

Steps to Reproduce the Issue

Play any audiobook on any device, pause the audiobook, move to another device and press play.

The playback position doesn't match.

What was Expected?

On any user interaction the app should sync to the server, on pause it should save position, on play it should check for the last playback time saved and move to that time.

Phone Model

Samsung S23, Samsung Tab S9, Bigme Hibreak

Phone OS

Android 11, Android 13, Android 14

Audiobookshelf App Version

iOS App - 0.9.77

Installation Source

Google Play Store

Additional Notes

This has been happening for months, happens in android auto, happens everywhere. The only reason I use this software is for multiple device sync and it never works.

@ggrensteiner ggrensteiner added the bug Something isn't working label Dec 22, 2024
@nichwall
Copy link
Contributor

Can you check the History view for the item in the Android app? You can view if sync is happening to the server correctly.

Screenshot_20241222-095205.png

There are still sync issues with different use cases. To help ensure things sync correctly, you can ensure clients are completely closed when not using the client (not leaving the app open in the background, not leaving a browser tab open). Progress should still be synced while the web socket is open, but leaving clients open in the background usually allows the device to kill the client or close the websocket to the server.

@ggrensteiner
Copy link
Author

ggrensteiner commented Dec 23, 2024

Sounds like you know the problems that need fixing. Me posting a bunch of screenshot aren't going to advance the issue at all.

How about rather than I check that and force close my apps every time I use them you make it so the app forces a sync on user interaction and only syncs to the posted time if the local position timestamp is older than the servers? That will fix the problem that everyone seems to have with downloaded content position being overwritten by old server position data; the way Android auto play never syncs it's position at all as well as my problem.

@nichwall
Copy link
Contributor

nichwall commented Dec 23, 2024

The position is synced whenever connecting to the server (such as when opening the app). There are a number of sync issues that get reported, but root causes haven't all been found.

I personally only really listen to downloaded content and haven't had the position overwritten by the server like this even when listening in areas of poor cell reception. I know sync issues get reported a lot but I haven't been able to reproduce them.

@kmaid
Copy link

kmaid commented Dec 25, 2024

Switching from web to android constantly moves my position back. I wish when the app is opened and the audio book is paused it updates from the server every time

@ggrensteiner
Copy link
Author

The position is synced whenever connecting to the server (such as when opening the app). There are a number of sync issues that get reported, but root causes haven't all been found.

I personally only really listen to downloaded content and haven't had the position overwritten by the server like this even when listening in areas of poor cell reception. I know sync issues get reported a lot but I haven't been able to reproduce them.

Use two devices, one synced and one streaming. You'll end up with almost random positions on both. It's like the sync system doesn't even check the commit time of the last recorded position on the server and just flips a coin on whether to override the listen position on the android downloaded media.

How it should work is when there's any user interaction on the android device, including a pause caused by bluetooth disconnect, a server position sync is queued with a time stamp. If the server is online it syncs, if not once the server reconnects that position gets entered ONLY IF the currently committed position on the server is older than it's own position.

On a play request a server check should be initiated and the new position from the server is used ONLY IF that commit timestamp (not position time, the actual clock time when the last pause was seen) is newer than it's own local position, queued or not, so it's not randomly dropping hours of listened and forcing me to find where my damn phone's position was because it decided to use a time from two days ago for no reason that I can tell at all.

This would also fix the months old bug where this app doesn't track listened time for android auto listening sessions at all, even if it's done 100% by streaming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants