Skip to content

fix(server): resolve Seerr addUser returning NULL#2436

Merged
ydkmlt84 merged 3 commits into
Maintainerr:mainfrom
enoch85:fix/seerr-adduser-null
Feb 28, 2026
Merged

fix(server): resolve Seerr addUser returning NULL#2436
ydkmlt84 merged 3 commits into
Maintainerr:mainfrom
enoch85:fix/seerr-adduser-null

Conversation

@enoch85

@enoch85 enoch85 commented Feb 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2434 — the addUser rule getter returns [] instead of usernames after upgrading to v3.0.

Root Cause

The Seerr unification (#2397) replaced plexApi.getCorrectedUsers() (Plex.tv account IDs) with mediaServer.getUsers() (local Plex server account IDs). These IDs don't match the Seerr user's plexId, so .find() always returned undefined → empty usernames array.

Fix

Read username fields directly from the Seerr API response instead of doing an ID lookup against the media server:

user.plexUsername || user.jellyfinUsername || user.username || undefined

This works for all Seerr user types (Plex, Jellyfin, Emby, Local) and eliminates the need for the getUsers() call entirely.

Additional fixes

  • Added return null in the addUser catch block to prevent silent switch-case fallthrough
  • Deduplicated identical season/non-season code paths into a single loop

Tests

Added 11 unit tests covering all user types, fallback logic, deduplication, empty requests, and error handling. All 493 tests pass.

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.
@enoch85 enoch85 requested a review from ydkmlt84 as a code owner February 28, 2026 13:28
@enoch85

enoch85 commented Feb 28, 2026

Copy link
Copy Markdown
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
@ydkmlt84 ydkmlt84 merged commit c4eb986 into Maintainerr:main Feb 28, 2026
9 checks passed
@enoch85 enoch85 deleted the fix/seerr-adduser-null branch February 28, 2026 18:35
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Seerr - Requested by user' is NULL

2 participants