Sofarr displays 'Unknown' for requesting user despite valid Ombi user data #51

Closed
opened 2026-05-26 11:12:02 +01:00 by Gandalf · 1 comment
Owner

Bug Description

Sofarr displays "Unknown" for the requesting user on requests, even when the Ombi database contains valid user information.

Root Cause Analysis

After examining the Ombi database and Sofarr codebase:

  1. Database State: The RequestedByAlias field in Ombi's request tables (ChildRequests, MovieRequests, AlbumRequests) is NULL for all 569 requests in the database. This field was added around 2019 but has never been populated in this installation.

  2. Expected Behavior: Sofarr should extract user information from the Ombi API's requestedUser object, which contains full user details (alias, userName, normalizedUserName, etc.).

  3. Current Behavior: Sofarr's extractRequestedUser() function in both server/utils/ombiHelpers.js and client/src/ui/requests.js has the correct priority logic:

    // Priority: alias > userAlias > userName > normalizedUserName > requestedByAlias
    return requestedUser.alias || requestedUser.Alias ||
           requestedUser.userAlias || requestedUser.UserAlias ||
           requestedUser.userName || requestedUser.UserName ||
           requestedUser.normalizedUserName || requestedUser.NormalizedUserName ||
           request.requestedByAlias || request.RequestedByAlias || '';
    
  4. The Issue: The Ombi API is likely not returning the expected requestedUser object structure, or Sofarr is not properly parsing it. Since RequestedByAlias is NULL for all requests, Sofarr falls back to an empty string and displays "Unknown".

Evidence

  • Database query shows 0 records with non-NULL RequestedByAlias across all request tables
  • User "Gordon" has no alias set in AspNetUsers.Alias
  • The "Mating Season" request (most recent, 2026-05-26) shows as "Unknown" despite having valid RequestedUserId
  • The pattern affects 569 requests spanning from 2019-07-13 to 2026-05-26

Expected Fix

Sofarr should ensure it's properly extracting user information from the Ombi API's requestedUser object response. The fix should be in the Ombi API integration layer, not in the database.

The application should:

  1. Verify the Ombi API is returning the expected user object structure
  2. Ensure the response parsing correctly extracts user information from the nested object
  3. Add better error handling/logging when user information cannot be extracted
  4. Consider adding a fallback to use RequestedUserId to query user details if the object is malformed

Steps to Reproduce

  1. View any request in Sofarr (e.g., "Mating Season" requested by Gordon)
  2. Observe that the requesting user shows as "Unknown"
  3. Check the Ombi database - the request has a valid RequestedUserId pointing to user "Gordon"
## Bug Description Sofarr displays "Unknown" for the requesting user on requests, even when the Ombi database contains valid user information. ## Root Cause Analysis After examining the Ombi database and Sofarr codebase: 1. **Database State**: The `RequestedByAlias` field in Ombi's request tables (ChildRequests, MovieRequests, AlbumRequests) is NULL for all 569 requests in the database. This field was added around 2019 but has never been populated in this installation. 2. **Expected Behavior**: Sofarr should extract user information from the Ombi API's `requestedUser` object, which contains full user details (alias, userName, normalizedUserName, etc.). 3. **Current Behavior**: Sofarr's `extractRequestedUser()` function in both `server/utils/ombiHelpers.js` and `client/src/ui/requests.js` has the correct priority logic: ```javascript // Priority: alias > userAlias > userName > normalizedUserName > requestedByAlias return requestedUser.alias || requestedUser.Alias || requestedUser.userAlias || requestedUser.UserAlias || requestedUser.userName || requestedUser.UserName || requestedUser.normalizedUserName || requestedUser.NormalizedUserName || request.requestedByAlias || request.RequestedByAlias || ''; ``` 4. **The Issue**: The Ombi API is likely not returning the expected `requestedUser` object structure, or Sofarr is not properly parsing it. Since `RequestedByAlias` is NULL for all requests, Sofarr falls back to an empty string and displays "Unknown". ## Evidence - Database query shows 0 records with non-NULL RequestedByAlias across all request tables - User "Gordon" has no alias set in AspNetUsers.Alias - The "Mating Season" request (most recent, 2026-05-26) shows as "Unknown" despite having valid RequestedUserId - The pattern affects 569 requests spanning from 2019-07-13 to 2026-05-26 ## Expected Fix Sofarr should ensure it's properly extracting user information from the Ombi API's `requestedUser` object response. The fix should be in the Ombi API integration layer, not in the database. The application should: 1. Verify the Ombi API is returning the expected user object structure 2. Ensure the response parsing correctly extracts user information from the nested object 3. Add better error handling/logging when user information cannot be extracted 4. Consider adding a fallback to use RequestedUserId to query user details if the object is malformed ## Steps to Reproduce 1. View any request in Sofarr (e.g., "Mating Season" requested by Gordon) 2. Observe that the requesting user shows as "Unknown" 3. Check the Ombi database - the request has a valid RequestedUserId pointing to user "Gordon"
Gandalf added the Kind/Bug
Priority
Medium
3
labels 2026-05-26 11:12:02 +01:00
Author
Owner

Resolved in commit 5390bbf (develop) and merged in 6f6aa5b (release v1.7.20).

Resolved in commit 5390bbf (develop) and merged in 6f6aa5b (release v1.7.20).
Gandalf added the Area/Proxy label 2026-05-28 11:58:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Gandalf/sofarr#51