mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: 2.13.x introduced something that breaks the user linking on the mobile app #2298
Closed
opened 2026-04-25 00:05:50 +02:00 by adam
·
25 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#2298
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 @FreedomBen on GitHub (Oct 8, 2024).
What happened?
After upgrading from 2.12.3 to 2.13.4, the mobile app no longer recognizes that the local user is the same as the remote user, and thus we get the message saying that progress will not be synced (and it really isn't).
What did you expect to happen?
Progress continues to sync with local media as it did before.
Steps to reproduce the issue
Audiobookshelf version
v2.13.4
How are you running audiobookshelf?
Docker
What OS is your Audiobookshelf server hosted from?
Linux
If the issue is being seen in the UI, what browsers are you seeing the problem on?
None
Logs
Additional Notes
Downgrading back to 2.12.3 fixes the issue
@FreedomBen commented on GitHub (Oct 8, 2024):
Well damn, standby on this one. I'm currently working on narrowing down the exact version that introduced the bug and after downgrading and working my way back up, it's now working on 2.13.4. I'll play with it a bit more but if I can't reproduce then I'll close this.
@FreedomBen commented on GitHub (Oct 8, 2024):
Ok now after doing a full library scan, it's back. I need to re-test the other versions now with also doing a full scan, so the debugging continues...
@FreedomBen commented on GitHub (Oct 8, 2024):
Confirmed: bug is not present in 2.12.3, but is present in 2.13.4. Will continue the narrowing process.
@nichwall commented on GitHub (Oct 8, 2024):
2.13.x included cleaning up old data models from before the SQLite database, so may be related to something there. I assume the issue does not go away on 2.14.0 (released 3 days ago)?
@FreedomBen commented on GitHub (Oct 16, 2024):
Had to suspend debugging effort because my hard drive filled up. Btw, BTRFS really doesn't do well when full. The read/write speeds slowed down to absurd levels, which made it impossible to boot from the drive. I booted with a live disc and started cleaning stuff up, but it took days to move 20 GB of data. Finally back up so will resume debugging as I have time.
@FreedomBen commented on GitHub (Oct 18, 2024):
Ok, confirmed that the bug was introduced in 2.13.0. It is not present in 2.12.3.
And damn, there's a lot of changes between the two... I'll look through the changes and see if anything stands out, but I'm not super optimistic.
https://github.com/advplyr/audiobookshelf/compare/v2.12.3...v2.13.0
@mikiher commented on GitHub (Nov 4, 2024):
There were certainly many changes around the user model in 2.13.0.
Are you still observing the issue with the latest server version (2.16.2)?
Also, for the record, which client version are you using?
Can you please take a screenshot of the message you're seeing on the client and put it here?
@vb0 commented on GitHub (Nov 4, 2024):
This bug is happening to me since a while too. Can reproduce on the latest server and app, at least as far as they get automatically updated: 2.16.2 with 0.9.76-beta
For what is worth the server has just one user (and the client connects only to this server, is a really tiny setup).
@mikiher commented on GitHub (Nov 4, 2024):
Thanks for the details. And are you logged in as root or some other user?
@vb0 commented on GitHub (Nov 4, 2024):
I have just one account overall, that is also "Account Type: root".
(also I had only one user, and the same, ever since I installed it -early 2023- BTW the software is absolutely great, never had any trouble whatsoever, even this is minor, but just wanted to help the OP to get it fixed and confirm the issue).
@nichwall commented on GitHub (Nov 4, 2024):
Some discussion over here as well https://github.com/advplyr/audiobookshelf-app/issues/1320
Do you know when the last time you signed in to the server was? There was an issue a while ago (may have been during the SQlite migration in 2.3.x, but I think it was a few server versions afterwards when the issue popped up and I can't find the relevant discussions) where the old user ID was incorrectly being checked by the app against the new user ID. Resetting the app/deleting the server connection fixed it at that time and users are currently reporting the issue resolved when they reset the app in this same way. I'm not sure if this is the same issue, but it may be related.
Edit to add: a later app update added the checking against the old user ID back in to fix it, so the server may no longer be providing the old user ID
@vb0 commented on GitHub (Nov 4, 2024):
Good idea, I actually logged in again not a long time ago (this issue was there both before and after), but I didn't reinstall/wipe storage for the app. Now I did it and the message is gone, but I'm reluctant to say it's fixed because last time I tried to "fix" this I removed all downloads, then downloaded just one audiobook (just as now too) but it took some time for the message to appear again. In any case I'm using this daily, if it comes back again I'll update here.
@mikiher commented on GitHub (Nov 5, 2024):
OK, here's my analysis of what's happening:
The book was downloaded to local storage with an
oldUserId(probably a long time ago?). TheoldUserIdwas stored locally in the book'slocalLibraryItem.serverUserId, in order to match against the server'soldUserId(see code here):Since server release v2.13.0, the user record returned from the server during login no longer contains
oldUserId, sothis.localLibraryItem.serverUserId === this.user.oldUserIdis nowfalseinstead oftrue.@advplyr, maybe this can be fixed with some local db "migration" in the app, but this will probably be an overkill.
My recommendation would be to remove the local item and re-download it. This might be a bit inconvenient but will most probably solve the sync issue.
@mikiher commented on GitHub (Nov 5, 2024):
So for those who want a quick resolution without the technical details:
After upgrading to server release > v2.13.0, delete the book from local storage and re-download it, and the sync issue will go away.
A future version of the mobile app may resolve this without needing to re-download, but the fix might not happen due to its complexity, so probably don't count on it.
@advplyr commented on GitHub (Nov 5, 2024):
Ah yeah I removed the old user id in v2.13.0. It's been almost 18 months since we stopped using the old user id and I didn't think about old downloads.
I don't think it is worth the effort of fixing this one since re-downloading fixes it.
@nichwall commented on GitHub (Nov 5, 2024):
I think the distinction is how the user signs in as well, because there have been a few people who have mentioned "redownloading did not fix it", but I'm not sure if they mean redownloading the book, redownloading the app without clearing cache, or something else.
Users who completely sign out (remove server from app, sign in again and redownload media) have reported the problem as fixed.
Edit to add: I think the other problem is people not updating their servers, so they (and we) don't realize they were on an old server version more recently. Probably less common, but I think all reports are people who have been using ABS for a while and more likely to fall in the "did not update server" category.
@advplyr commented on GitHub (Nov 5, 2024):
You're right, that is a bit more problematic. The saved connection on the device also stores the user id which could be an old user id if set up before July 2023.
The server still allows connecting with old user ids.
Do we know that removing the connection and adding it again fixes it for future downloads?
@nichwall commented on GitHub (Nov 5, 2024):
The steps I have told people to do (in several GH issues and on Discord since it happened originally with the database migration, and some in more recent weeks) are to reset the app to be safe, and then sign in from a fresh state since at the time I wasn't exactly sure if there was a migration issue or if it was the app getting into a weird state. Every time someone reset the app, they reported the problem being fixed. The main complaint was needing to redo any downloads, which they did not consider as a good fix for less tech-saavy family members.
I believe just removing the server connection and signing in again would achieve the same thing if the old user ID is part of the connection.
@advplyr commented on GitHub (Nov 5, 2024):
I thought with the db migration users had to set up a new connection and we went through that process of asking users to set up a new connection
@nichwall commented on GitHub (Nov 5, 2024):
I think a number of people just didn't do it because we added the "old user ID check" to the app, so yes a lot of people signed out/in, but other people just didn't do it, which would also explain why it was difficult to track down.
@mikiher commented on GitHub (Nov 5, 2024):
OK, so can we just state here clearly what are the resolution steps, based on the discussion above, for the benefit of the bug's reporters?
@mikiher commented on GitHub (Nov 5, 2024):
Is there a good reason for allowing that after v2.13.0?
@advplyr commented on GitHub (Nov 5, 2024):
I'm hoping to push the mobile app release this afternoon. Maybe I can see about adding in a message notifying users with old IDs to set up a new connection. That would be easier than building out a script that does it automatically and we could give a week or 2 before forcing it in a server update.
@Pwnz74 commented on GitHub (Nov 28, 2024):
I got server version: 2.17 redownload did not worked for me after removal of local item. It did not even work on 2.16.
Use using root both App and server.
@nichwall commented on GitHub (Nov 28, 2024):
You need to delete the connection to the server (from the Switch User/Server menu) within the mobile app, or reset the app data/cache. The user ID is linked to when you originally logged in to the server.
Edit to add: the problem is with the user ID from before 2.4.0, released about year and a half ago.