Skip to content

Watchlist sync permission check uses AUTO_APPROVE_TV instead of AUTO_REQUEST_TV #4309

@fronc

Description

@fronc

Description

There is a typo in server/lib/watchlistsync.ts at line 47. The permission check uses Permission.AUTO_APPROVE_TV instead of Permission.AUTO_REQUEST_TV:

// Current (buggy) - line 47
if (
  !user.hasPermission(
    [
      Permission.AUTO_REQUEST,
      Permission.AUTO_REQUEST_MOVIE,
      Permission.AUTO_APPROVE_TV,  // <-- Should be AUTO_REQUEST_TV
    ],
    { type: 'or' }
  )
) {
  return;
}

Impact

This bug affects:

  1. Users with only AUTO_REQUEST_TV permission - They are incorrectly skipped during watchlist sync because their TV permission isn't recognized
  2. Future edge cases where permission bitwise checks behave unexpectedly due to checking the wrong permission type (implemented in feat: Allow admin/owner to opt out of auto-approval #4308)

Root Cause

Simple typo: AUTO_APPROVE_TV vs AUTO_REQUEST_TV

Fix

Change line 47 from:

Permission.AUTO_APPROVE_TV

to:

Permission.AUTO_REQUEST_TV

Related Issues

This may be the root cause of #4202 (Watchlist auto-request not populating)

Version

develop branch (current)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions