mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
Audio Sync between devices resets sync to zero on new login (Does not include iOS or Android App) #1892
Closed
opened 2026-04-25 00:01:01 +02:00 by adam
·
12 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
sqlite
playlists
video
v2.35.1
v2.35.0
v2.34.0
v2.33.2
v2.33.1
v2.33.0
v2.32.1
v2.32.0
v2.31.0
v2.30.0
v2.29.0
v2.28.0
v2.27.0
v2.26.3
v2.26.2
v2.26.1
v2.26.0
v2.25.1
v2.25.0
v2.24.0
v2.23.0
v2.22.0
v2.21.0
v2.20.0
v2.19.5
v2.19.4
v2.19.3
v2.19.2
v2.19.1
v2.19.0
v2.18.1
v2.18.0
v2.17.7
v2.17.6
v2.17.5
v2.17.4
v2.17.3
v2.17.2
v2.17.1
v2.17.0
v2.16.2
v2.16.1
v2.16.0
v2.15.1
v2.15.0
v2.14.0
v2.13.4
v2.13.3
v2.13.2
v2.13.1
v2.13.0
v2.12.3
v2.12.2
v2.12.1
v2.12.0
v2.11.0
v2.10.1
v2.10.0
v2.9.0
v2.8.1
v2.8.0
v2.7.2
v2.7.1
v2.7.0
v2.6.0
v2.5.0
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.5
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.23
v2.2.22
v2.2.21
v2.2.20
v2.2.19
v2.2.18
v2.2.17
v2.2.16
v2.2.15
v2.2.14
v2.2.13
v2.2.12
v2.2.11
v2.2.10
v2.2.9
v2.2.8
v2.2.7
v2.2.6
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.24
v2.0.23
v2.0.22
v2.0.21
v2.0.20
v2.0.19
v2.0.18
v2.0.17
v2.0.16
v2.0.15
v2.0.14
v2.0.13
v2.0.12
v2.0.11
v2.0.10
v2.0.9
v2.0.8
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v1.7.2
v1.7.1
v1.7.0
v1.6.0
v1.5.5
v1.5.0
v1.4.11
v1.4.9
v1.4.7
v1.4.6
v1.4.4
v1.4.2
v1.4.0
v1.4.1
v1.3.4
v1.3.3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#1892
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CameraSkunk on GitHub (Apr 17, 2024).
Steps to reproduce
Expected behaviour
Actual behaviour
Environment data
Server Information:
Test Devices:
Device 1: Windows 11 PC, Google Chrome v123.0.6312.123
Device 2: Iphone 14 Pro IOS v 17.4.1 / Using: Mobile Safari and Mobile Google Chrome
Audiobookshelf Version:
Android Issue
Android version:
Device model:
Stock or customized system:
iOS Issue
iOS Version: 17.4.1
iPhone model: Iphone 14 Pro
@CameraSkunk commented on GitHub (Apr 17, 2024):
Should Have added some logs. I turned on Debug to run through a bit of the test: I attempted to capture the point on Device 1 Listening and jogging then exiting that session to open on Device 2 where it opened at time stamp 00:00
@nichwall commented on GitHub (Apr 17, 2024):
"Latest" being 2.8.1 or the most recent
edgeimage?Probably unrelated, but to clarify the database located in
/configis not accessible over a network? SQLite does not play nice with being accessed over a network or multiple processes accessing it, and not sure how docker swarm does that.@CameraSkunk commented on GitHub (Apr 17, 2024):
Latest being 2.8.1 yes.
the way the swarm is set up there is a copy of the config directory and gluster almost instantly copies any changes to the other two in case I shut down the container and open it on a different node. Once the container is opened it should be acting like it is on a single device.
I can isolate it to a test unit once home on a pi4 if you’d like. Willing to help any way I can, I’m just not a developer, I’m a systems analyst.
@nichwall commented on GitHub (Apr 17, 2024):
I'm not sure if gluster won't cause any (other) problems since SQLite also doesn't like being copied/updated while in use.
Are you seeing anything like
starting direct play sessionsorsync sessionin the logs?Also @advplyr this belongs in the other repo
@CameraSkunk commented on GitHub (Apr 17, 2024):
I do see a starting direct play in the debug logs.
I can isolate this out of the swarm after and see how it works out that way. That will be latter this evening Eastern Time. I’ll respond with my findings in case that isolates the issue. If so I’ll run this outside of swarm. I’d call this an edge case in development and not worth the time to solve if it’s a one off use case.
@CameraSkunk commented on GitHub (Apr 18, 2024):
I recreated the container on a single Pi that is on a different IP and not a part of the swarm mentioned in the original bug report. I am getting very similar results where if I start listening on a PC and then close the session. Then log into a mobile device and attempt to pick back up where I left off, the mobile device always returns to the 00:00 time. I did notice that the mobile device always restarts at 00:00 even if I start listening on the phone, close the session, sign back in and try to start listening again.
Image of the logs from that time:

@CameraSkunk commented on GitHub (Apr 18, 2024):
(I appologize for putting this in the incorrect repo)
One more tidbit that I was able to isolate today. This appears to be limited to mobile use, at least in my case Iphone 14 pro using safari or google mobile browsers.. I attempted multiple computers and the time position was maintained even in incognito mode.
@advplyr commented on GitHub (Apr 18, 2024):
Note that when you first press play in the browser it will be 30 seconds before the first sync happens. This is so that you have to close out of the audio player if you accidently pressed play.
Can you try reproducing this again with more specific steps that include how long you are listening (at least 30 seconds), and if you are able to see the accurate progress on the book page before you start playing?
So you would note that this progress block is correct before you start playing.
@CameraSkunk commented on GitHub (Apr 18, 2024):
Recreation Steps Taken:
[2024-04-18 17:13:29.590] DEBUG: [PlaybackSessionManager] syncSession "7b808aef-b3f6-4f4f-ac15-7cf01a52e0fe" (Device: Windows 10 / Chrome) | Total Time Listened: 209 (PlaybackSessionManager.js:276)
[2024-04-18 17:13:29.618] DEBUG: [ApiCacheManager] Array.afterUpsert: Clearing cache (ApiCacheManager.js:21)
[2024-04-18 17:13:29.643] DEBUG: [ApiCacheManager] Object.afterBulkUpdate: Clearing cache (ApiCacheManager.js:21)
2)Stopped playback and logged out on the PC I was using after waiting another 30 seconds or so. Logs Created:
[2024-04-18 17:14:53.164] DEBUG: [PlaybackSessionManager] closeSession "7b808aef-b3f6-4f4f-ac15-7cf01a52e0fe" (PlaybackSessionManager.js:306)
[2024-04-18 17:14:53.166] DEBUG: [PlaybackSessionManager] Removed session "7b808aef-b3f6-4f4f-ac15-7cf01a52e0fe" (PlaybackSessionManager.js:330)
[2024-04-18 17:15:01.378] DEBUG: [SocketAuthority] User Offline CameraSkunk (SocketAuthority.js:131)
[2024-04-18 17:15:01.379] INFO: [SocketAuthority] Socket a0P94_wGrm4IsQPlAAAf disconnected from client "CameraSkunk" after 314474ms (Reason: client namespace disconnect)
[2024-04-18 17:15:01.378] DEBUG: [SocketAuthority] User Offline CameraSkunk (SocketAuthority.js:131)
[2024-04-18 17:15:01.379] INFO: [SocketAuthority] Socket a0P94_wGrm4IsQPlAAAf disconnected from client "CameraSkunk" after 314474ms (Reason: client namespace disconnect)
[2024-04-18 17:16:18.367] DEBUG: [ApiCacheManager] count: 0 size: 0 (ApiCacheManager.js:39)
[2024-04-18 17:16:18.401] DEBUG: [ApiCacheManager] Cache miss: {"user":"CameraSkunk","url":"/libraries/a914be17-4a81-4c5a-ba12-013443de450e?include=filterdata"} (ApiCacheManager.js:50)
[2024-04-18 17:16:18.471] INFO: [SocketAuthority] Socket Connected e28Mc6hIRj4AWHREAAAh
[2024-04-18 17:16:18.555] DEBUG: [SocketAuthority] User Online CameraSkunk (SocketAuthority.js:204)
[2024-04-18 17:16:18.559] DEBUG: [ApiCacheManager] count: 1 size: 1553 (ApiCacheManager.js:39)
[2024-04-18 17:16:18.561] DEBUG: [ApiCacheManager] count: 1 size: 1553 (ApiCacheManager.js:39)
[2024-04-18 17:16:18.680] DEBUG: [ApiCacheManager] Cache miss: {"user":"CameraSkunk","url":"/libraries"} (ApiCacheManager.js:50)
[2024-04-18 17:16:18.832] DEBUG: Loaded 1 of 1 items for "Continue Listening/Reading" in 0.15s (LibraryItem.js:611)
[2024-04-18 17:16:18.886] DEBUG: Loaded 0 of 0 items for "Continue Series" in 0.05s (LibraryItem.js:628)
[2024-04-18 17:16:18.981] DEBUG: Loaded 8 of 8 items for "Recently Added" in 0.09s (LibraryItem.js:658)
[2024-04-18 17:16:19.048] DEBUG: Loaded 1 of 1 series for "Recent Series" in 0.07s (LibraryItem.js:674)
[2024-04-18 17:16:19.203] DEBUG: Loaded 2 of 2 items for "Discover" in 0.15s (LibraryItem.js:689)
[2024-04-18 17:16:19.256] DEBUG: Loaded 0 of 0 items for "Listen/Read Again" in 0.05s (LibraryItem.js:720)
[2024-04-18 17:16:19.290] DEBUG: Loaded 4 of 4 authors for "Newest Authors" in 0.03s (LibraryItem.js:736)
[2024-04-18 17:16:19.291] DEBUG: Loaded 5 personalized shelves in 0.61s (LibraryItem.js:739)
[2024-04-18 17:16:19.292] DEBUG: [ApiCacheManager] Cache miss: {"user":"CameraSkunk","url":"/libraries/a914be17-4a81-4c5a-ba12-013443de450e/personalized?include=rssfeed,numEpisodesIncomplete"} (ApiCacheManager.js:50)
[2024-04-18 17:16:19.292] DEBUG: [ApiCacheManager] Caching with 1800000 ms TTL (ApiCacheManager.js:53)
Navigate to the audiobook page. Observation shows that Progress box shows approximately what i would expect at 3% and 15hr 12 min remaining. (Note no logs created at this stage)
Hit play for the book under the progress bar. Book restarted at 0:00. Interestingly it does not look like the bar in the media player on the page is showing any movement. It continues to read as 0:00 and I can't use it to navigate to another time in the chapter or book. (Not sure if this last part is helpful but it is an observation) Logs Created:
[2024-04-18 17:18:06.282] DEBUG: [ApiCacheManager] Object.afterBulkUpdate: Clearing cache (ApiCacheManager.js:21)
[2024-04-18 17:18:06.283] DEBUG: [PlaybackSessionManager] startSessionRequest for device iOS 17.4 / Chrome (PlaybackSessionManager.js:64)
[2024-04-18 17:18:06.285] DEBUG: [PlaybackSessionManager] "CameraSkunk" starting direct play session for item "0ca8535a-9aca-44b3-ae18-5fad1eef6ae1" with id fef1de8f-78d9-448b-b426-ffa83c785d3a (Device: iOS 17.4 / Chrome) (PlaybackSessionManager.js:240)
[2024-04-18 17:18:26.626] DEBUG: [PlaybackSessionManager] syncSession "fef1de8f-78d9-448b-b426-ffa83c785d3a" (Device: iOS 17.4 / Chrome) | Total Time Listened: 20 (PlaybackSessionManager.js:276)
[2024-04-18 17:18:26.656] DEBUG: [ApiCacheManager] Array.afterUpsert: Clearing cache (ApiCacheManager.js:21)
[2024-04-18 17:18:26.681] DEBUG: [ApiCacheManager] playbackSession.afterCreate: Clearing cache (ApiCacheManager.js:21)
6)Went back to pc and the audio book reset back to zero even on the PC after returning from my phone. Progress box also reset to 0% and now 15 hours 40 min. Logs Created:
[2024-04-18 17:20:30.002] DEBUG: [SocketAuthority] User Offline CameraSkunk (SocketAuthority.js:131)
[2024-04-18 17:20:30.003] INFO: [SocketAuthority] Socket e28Mc6hIRj4AWHREAAAh disconnected from client "CameraSkunk" after 251532ms (Reason: transport close)
[2024-04-18 17:20:35.581] DEBUG: [ApiCacheManager] count: 0 size: 0 (ApiCacheManager.js:39)
[2024-04-18 17:20:35.613] DEBUG: [ApiCacheManager] Cache miss: {"user":"CameraSkunk","url":"/libraries/a914be17-4a81-4c5a-ba12-013443de450e?include=filterdata"} (ApiCacheManager.js:50)
[2024-04-18 17:20:35.789] DEBUG: [ApiCacheManager] count: 1 size: 1553 (ApiCacheManager.js:39)
[2024-04-18 17:20:35.837] INFO: [SocketAuthority] Socket Connected qDfCbIae8jPGrTH1AAAj
[2024-04-18 17:20:35.892] DEBUG: Loaded 1 of 1 items for "Continue Listening/Reading" in 0.09s (LibraryItem.js:611)
[2024-04-18 17:20:35.955] DEBUG: Loaded 0 of 0 items for "Continue Series" in 0.06s (LibraryItem.js:628)
[2024-04-18 17:20:35.960] DEBUG: [SocketAuthority] User Online CameraSkunk (SocketAuthority.js:204)
[2024-04-18 17:20:36.070] DEBUG: Loaded 8 of 8 items for "Recently Added" in 0.12s (LibraryItem.js:658)
[2024-04-18 17:20:36.129] DEBUG: Loaded 1 of 1 series for "Recent Series" in 0.06s (LibraryItem.js:674)
[2024-04-18 17:20:36.159] DEBUG: [ApiCacheManager] count: 1 size: 1553 (ApiCacheManager.js:39)
[2024-04-18 17:20:36.188] DEBUG: [ApiCacheManager] Cache miss: {"user":"CameraSkunk","url":"/libraries"} (ApiCacheManager.js:50)
[2024-04-18 17:20:36.262] DEBUG: Loaded 2 of 2 items for "Discover" in 0.13s (LibraryItem.js:689)
[2024-04-18 17:20:36.308] DEBUG: Loaded 0 of 0 items for "Listen/Read Again" in 0.04s (LibraryItem.js:720)
[2024-04-18 17:20:36.340] DEBUG: Loaded 4 of 4 authors for "Newest Authors" in 0.03s (LibraryItem.js:736)
[2024-04-18 17:20:36.340] DEBUG: Loaded 5 personalized shelves in 0.54s (LibraryItem.js:739)
[2024-04-18 17:20:36.340] DEBUG: [ApiCacheManager] Cache miss: {"user":"CameraSkunk","url":"/libraries/a914be17-4a81-4c5a-ba12-013443de450e/personalized?include=rssfeed,numEpisodesIncomplete"} (ApiCacheManager.js:50)
[2024-04-18 17:20:36.341] DEBUG: [ApiCacheManager] Caching with 1800000 ms TTL (ApiCacheManager.js:53)
[2024-04-18 17:20:39.764] DEBUG: [PlaybackSessionManager] startSessionRequest for device Windows 10 / Chrome (PlaybackSessionManager.js:64)
[2024-04-18 17:20:39.765] DEBUG: [PlaybackSessionManager] "CameraSkunk" starting direct play session for item "0ca8535a-9aca-44b3-ae18-5fad1eef6ae1" with id 33481e1b-d29c-402a-b2a0-bb7a13e1ced8 (Device: Windows 10 / Chrome) (PlaybackSessionManager.js:240)
[2024-04-18 17:21:00.379] DEBUG: [PlaybackSessionManager] syncSession "33481e1b-d29c-402a-b2a0-bb7a13e1ced8" (Device: Windows 10 / Chrome) | Total Time Listened: 20 (PlaybackSessionManager.js:276)
[2024-04-18 17:21:00.427] DEBUG: [ApiCacheManager] Array.afterUpsert: Clearing cache (ApiCacheManager.js:21)
[2024-04-18 17:21:00.449] DEBUG: [ApiCacheManager] playbackSession.afterCreate: Clearing cache (ApiCacheManager.js:21)
[2024-04-18 17:21:11.372] DEBUG: [PlaybackSessionManager] syncSession "33481e1b-d29c-402a-b2a0-bb7a13e1ced8" (Device: Windows 10 / Chrome) | Total Time Listened: 30 (PlaybackSessionManager.js:276)
[2024-04-18 17:21:11.402] DEBUG: [ApiCacheManager] Array.afterUpsert: Clearing cache (ApiCacheManager.js:21)
[2024-04-18 17:21:11.428] DEBUG: [ApiCacheManager] Object.afterBulkUpdate: Clearing cache (ApiCacheManager.js:21)
@advplyr commented on GitHub (Apr 18, 2024):
This seems similar to issues in the past with poorly encoded audio files. What format is the audiobook? mp3 or m4b, multi-track or single track?
Can you test with another audiobook, preferably one not from the same source. It could be any audio file you put in a folder.
@CameraSkunk commented on GitHub (Apr 18, 2024):
Didn't think of that. Files are mp3 files. To be clear about the multi/single track item. There are multiple mp3, one per chapter.
I did as you asked and attempted with a different book that is actually in m4b format and that one appears to work flawlessly. I then attempted with another book that is in similar situation from that of the first. Multiple mp3 files. That one works as well.
I do apologize it appears that one books is in poor format for some reason.
@advplyr commented on GitHub (Apr 18, 2024):
No problem, glad you got it figured out.