[Bug]: android- battery optimization causes sync errors #1218

Open
opened 2026-04-24 23:54:03 +02:00 by adam · 8 comments
Owner

Originally created by @UncommonGarb on GitHub (May 31, 2025).

I have verified that the bug is not already awaiting release

Yes

What was the Problem?

Androids battery optimization (on pixel anyway) causes sync errors in the background, not allowing them to go through until you open the app even while actively listening.

Steps to Reproduce the Issue

Start playing an audio book, leave the app, come back and see progress syncs fail and then succeed when the app opens.

What was Expected?

The syncs should work in the background, it would be nice to keep the sync working without optimization but the answer here might be to add prompts to the app guiding the user on how to disable battery optimization for proper sync in the background.

Phone Model

Pixel 7a

Phone OS

Androids 16 Qpr1

Audiobookshelf App Version

Android App - 0.9.81

Installation Source

Google Play Store

Additional Notes

Disabled battery optimization and it began working as expected.

Originally created by @UncommonGarb on GitHub (May 31, 2025). ### I have verified that the [bug is not already awaiting release](https://github.com/advplyr/audiobookshelf-app/issues?q=is%3Aissue%20label%3A%22awaiting%20release%22) Yes ### What was the Problem? Androids battery optimization (on pixel anyway) causes sync errors in the background, not allowing them to go through until you open the app even while actively listening. ### Steps to Reproduce the Issue Start playing an audio book, leave the app, come back and see progress syncs fail and then succeed when the app opens. ### What was Expected? The syncs should work in the background, it would be nice to keep the sync working without optimization but the answer here might be to add prompts to the app guiding the user on how to disable battery optimization for proper sync in the background. ### Phone Model Pixel 7a ### Phone OS Androids 16 Qpr1 ### Audiobookshelf App Version Android App - 0.9.81 ### Installation Source Google Play Store ### Additional Notes Disabled battery optimization and it began working as expected.
adam added the bugandroid labels 2026-04-24 23:54:03 +02:00
Author
Owner

@advplyr commented on GitHub (May 31, 2025):

Can you share what the battery settings look like for you?

I have a Pixel 6 on Android 15

Image

I'm also curious what your mobile data usage settings page looks like

Image

I think Android 14 had 3 options for battery usage. Unrestricted, Optimized, Restricted

@advplyr commented on GitHub (May 31, 2025): Can you share what the battery settings look like for you? I have a Pixel 6 on Android 15 ![Image](https://github.com/user-attachments/assets/afa4b7be-e090-4e77-b35d-f873e8c5c95a) I'm also curious what your mobile data usage settings page looks like ![Image](https://github.com/user-attachments/assets/119477bf-7069-45d9-8908-a6e7acf40b09) I think Android 14 had 3 options for battery usage. Unrestricted, Optimized, Restricted
Author
Owner

@UncommonGarb commented on GitHub (May 31, 2025):

Hi, yes. Currently if you tap into the extra menu it gives you the option to bypass optimization. Please see below.

Screenshot_20250531-112933.png

Tap into the menu and you get.

Screenshot_20250531-112936.png

And with it unrestricted the sync issues have seems to mitigate.

@UncommonGarb commented on GitHub (May 31, 2025): Hi, yes. Currently if you tap into the extra menu it gives you the option to bypass optimization. Please see below. ![Screenshot_20250531-112933.png](https://github.com/user-attachments/assets/7f372a4e-6f70-4d25-a164-1d28e093a08c) Tap into the menu and you get. ![Screenshot_20250531-112936.png](https://github.com/user-attachments/assets/27a99426-dab5-410c-8035-a3791acaf227) And with it unrestricted the sync issues have seems to mitigate.
Author
Owner

@advplyr commented on GitHub (May 31, 2025):

Ah that's where they put that. I have it on optimized and haven't had any issues with syncing. Are you sure this is the issue or are you having one of the other sync issues with android auto or progress reverting to server progress on downloaded books

@advplyr commented on GitHub (May 31, 2025): Ah that's where they put that. I have it on optimized and haven't had any issues with syncing. Are you sure this is the issue or are you having one of the other sync issues with android auto or progress reverting to server progress on downloaded books
Author
Owner

@advplyr commented on GitHub (May 31, 2025):

There is a history page that shows all the play/pause and sync events for the book. There is also a logs page that will show logs each time it syncs. Can you check those pages and see if you notice anything

@advplyr commented on GitHub (May 31, 2025): There is a history page that shows all the play/pause and sync events for the book. There is also a logs page that will show logs each time it syncs. Can you check those pages and see if you notice anything
Author
Owner

@UncommonGarb commented on GitHub (Jun 1, 2025):

I'll keep an eye on this and close this. I flipped it back to optimized without issue. Must have been another issue possibly with connection over data or something.

I used to have the sync issue where it erased downloaded information for server information, so far has been okay as of late.

@UncommonGarb commented on GitHub (Jun 1, 2025): I'll keep an eye on this and close this. I flipped it back to optimized without issue. Must have been another issue possibly with connection over data or something. I used to have the sync issue where it erased downloaded information for server information, so far has been okay as of late.
Author
Owner

@tigerhawkvok commented on GitHub (Sep 2, 2025):

I intermittently see sync issues, especially when I'm playing on Android Auto and then I come back and resume but it starts at an old point. I'm unsure if this is the same root cause.

@tigerhawkvok commented on GitHub (Sep 2, 2025): I intermittently see sync issues, especially when I'm playing on Android Auto and then I come back and resume but it starts at an old point. I'm unsure if this is the same root cause.
Author
Owner

@MelHarbour commented on GitHub (Jan 27, 2026):

I think I saw something like this bug, but indirectly. I didn't notice it originally via the sync errors themselves, but rather because ABS had burnt a chunk of my mobile data allowance. I was playing it through Android Auto, and then reviewing the log showed that there were a large number of sync errors.

@MelHarbour commented on GitHub (Jan 27, 2026): I think I saw something like this bug, but indirectly. I didn't notice it originally via the sync errors themselves, but rather because ABS had burnt a chunk of my mobile data allowance. I was playing it through Android Auto, and then reviewing the log showed that there were a large number of sync errors.
Author
Owner

@LordDrakath commented on GitHub (Feb 23, 2026):

I just had to troubleshoot this issue with a friend who was trying to download from my server.
When the android screen turns off, it closes the socket a few seconds later and halts the downloads. When you turn the screen back on, even if it reconnects to the server, all progress is frozen and doesn't resume.
I forcefully close the app, and then you can attempt to download again.
If you change battery optimization to unrestricted, it doesn't close the socket when the screen is turned off and the downloads continue until completed and then it disconnects.

@LordDrakath commented on GitHub (Feb 23, 2026): I just had to troubleshoot this issue with a friend who was trying to download from my server. When the android screen turns off, it closes the socket a few seconds later and halts the downloads. When you turn the screen back on, even if it reconnects to the server, all progress is frozen and doesn't resume. I forcefully close the app, and then you can attempt to download again. If you change battery optimization to unrestricted, it doesn't close the socket when the screen is turned off and the downloads continue until completed and then it disconnects.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1218