fix(server): resolve Seerr addUser returning NULL#2436
Merged
Conversation
Use plexUsername/jellyfinUsername/username fields directly from the Seerr API response instead of looking up users by ID on the media server. The v3.0 Seerr unification replaced getCorrectedUsers() (Plex.tv IDs) with mediaServer.getUsers() (local server IDs). These IDs don't match Seerr's plexId, causing the lookup to always fail and return empty arrays. Also fixes a switch-case fallthrough bug in the addUser catch block and deduplicates the season/non-season request handling into a single loop.
Collaborator
Author
|
@ydkmlt84 this is 2 PRs really. Seerr changes are one, and typeorm changes is one. If you want I can split it again, but was a bit stressed when committing. |
enoch85
added a commit
that referenced
this pull request
Feb 28, 2026
PR #2396 - feat(settings): unify connection-test error handling across services - Added shared backend/frontend error helpers for connection tests - Reduced connection test timeout to 3s and parallelized tests - Normalized user-facing error messages across all service test endpoints PR #2429 - fix: emit collection notification events only after successful operations - Moved event emissions to after operations complete - Only emits events for items that were truly added/removed - Pass touchedMediaServerIds to prevent incorrect removals during sync PR #2436 - fix(server): resolve Seerr addUser returning NULL - Use username fields directly from Seerr API response instead of media server ID lookup - Use workspace-local typeorm migration cli - Use initial setup terminology for media server success log - Added 11 unit tests for addUser covering all user types and edge cases
Contributor
|
🎉 This PR is included in version 3.0.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2434 — the
addUserrule getter returns[]instead of usernames after upgrading to v3.0.Root Cause
The Seerr unification (#2397) replaced
plexApi.getCorrectedUsers()(Plex.tv account IDs) withmediaServer.getUsers()(local Plex server account IDs). These IDs don't match the Seerr user'splexId, so.find()always returnedundefined→ empty usernames array.Fix
Read username fields directly from the Seerr API response instead of doing an ID lookup against the media server:
This works for all Seerr user types (Plex, Jellyfin, Emby, Local) and eliminates the need for the
getUsers()call entirely.Additional fixes
return nullin theaddUsercatch block to prevent silent switch-case fallthroughTests
Added 11 unit tests covering all user types, fallback logic, deduplication, empty requests, and error handling. All 493 tests pass.