Skip to content

Conversation

Copy link

Copilot AI commented Jul 14, 2025

Issue

When adding filters for Series and Movies, the streaming service filter does not persist across open/close of the filter panel. The filtering works correctly (URL parameters are maintained), but when reopening the filter panel, no streaming service appears selected.

Root Cause

The WatchProviderSelector component uses internal state (activeProvider and watchRegion) that gets initialized once with useState() but doesn't update when the props (activeProviders and region) change. When the filter panel reopens, the props contain the correct values from URL query params, but the internal state is stale.

Solution

Added useEffect hooks to synchronize the internal state with the prop values whenever they change:

// Sync internal state with props when they change
useEffect(() => {
  if (activeProviders !== undefined) {
    setActiveProvider(activeProviders);
  }
}, [activeProviders]);

useEffect(() => {
  if (region !== undefined) {
    setWatchRegion(region);
  }
}, [region]);

Technical Details

  • Uses !== undefined checks to properly handle empty arrays (when user clears selections)
  • Preserves component's default values when props are undefined
  • Minimal, surgical change affecting only the problematic component
  • No breaking changes to existing functionality

Testing

  • ✅ All existing linting checks pass
  • ✅ TypeScript compilation succeeds
  • ✅ Next.js build completes successfully
  • ✅ Logic verified with simulated unit tests

This fix ensures that when users reopen the filter panel, their streaming service selections are properly restored from the URL parameters.

Fixes #4159.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: /usr/local/bin/node index.js --exec install (dns block)
  • fonts.googleapis.com
    • Triggering command: node /home/REDACTED/work/overseerr/overseerr/node_modules/.bin/next build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Streaming service filter does not persist Fix streaming service filter persistence in WatchProviderSelector Jul 14, 2025
Copilot AI requested a review from sct July 14, 2025 01:49
Copilot finished work on behalf of sct July 14, 2025 01:49
@stale
Copy link

stale bot commented Dec 17, 2025

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 17, 2025
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.

Streaming service filter does not persist

2 participants