Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

fix: add push subscription verification and resubscribe logic#4163

Merged
sct merged 9 commits intodevelopfrom
fix/webpush-verify
Jun 27, 2025
Merged

fix: add push subscription verification and resubscribe logic#4163
sct merged 9 commits intodevelopfrom
fix/webpush-verify

Conversation

@OwsleyJr
Copy link
Copy Markdown
Collaborator

@OwsleyJr OwsleyJr commented Jun 22, 2025

Description

This PR introduces a new flow that improves how we manage Web Push subscriptions. Previously, subscriptions were created but there was no verification or refresh logic whenever the endpoint/keys expire.

With this update:

We now verify the existing subscription’s endpoint and VAPID key against what the backend expects.

If the subscription is invalid or missing, we unsubscribe from the backend and generate a new subscription.

Screenshot (if UI-related)

N/A

To-Dos

  • Successful build yarn build
  • Translation keys yarn i18n:extract
  • Database migration (if required)

@OwsleyJr OwsleyJr marked this pull request as draft June 22, 2025 16:26
@cypress
Copy link
Copy Markdown

cypress bot commented Jun 22, 2025

overseerr    Run #2821

Run Properties:  status check passed Passed #2821  •  git commit 8e1f05d958: fix: add push subscription verification and resubscribe logic
Project overseerr
Branch Review refs/pull/4163/merge
Run status status check passed Passed #2821
Run duration 02m 23s
Commit git commit 8e1f05d958: fix: add push subscription verification and resubscribe logic
Committer Brandon Cohen
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 28
View all changes introduced in this branch ↗︎

@OwsleyJr OwsleyJr marked this pull request as ready for review June 22, 2025 16:51
@OwsleyJr OwsleyJr force-pushed the fix/webpush-verify branch from 7415ccc to 016a6f9 Compare June 23, 2025 00:14
refactor: move one line of code

fix: add dependency in serviceworker
@OwsleyJr OwsleyJr force-pushed the fix/webpush-verify branch 2 times, most recently from 73678eb to c692446 Compare June 23, 2025 04:34
fix: add lock icon for better clarity

fix: add i18n language
@OwsleyJr OwsleyJr force-pushed the fix/webpush-verify branch from c692446 to d1b8ea9 Compare June 23, 2025 04:44
@sct sct requested a review from Copilot June 23, 2025 05:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves Web Push subscription management by introducing logic to verify the existing subscription and, if necessary, resubscribe with updated keys and endpoints.

  • Added helper functions for verifying, subscribing, unsubscribing, and resubscribing push notifications.
  • Updated UI components to reflect changes in push subscription state and actions, and integrated new backend communications.
  • Enhanced the service worker setup to verify and refresh subscriptions based on current settings and notification permissions.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/pushSubscriptionHelpers.ts Added functions to verify, subscribe, and unsubscribe push notifications with resubscribe logic.
src/i18n/locale/en.json Added translation for active push subscription status.
src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/index.tsx Updated push notification enable/disable flows with the new helper functions and additional state handling.
src/components/UserProfile/UserSettings/UserNotificationSettings/UserNotificationsWebPush/DeviceItem.tsx Modified UI logic to disable deletion for the active subscription and updated action handlers.
src/components/ServiceWorkerSetup/index.tsx Integrated verification and resubscription logic during service worker setup, including handling of notification permissions.

@OwsleyJr OwsleyJr force-pushed the fix/webpush-verify branch 2 times, most recently from 7a13cad to 4863034 Compare June 23, 2025 14:36
refactor: move from consoles to throws

refactor: add error to throw

refactor: remove unnecessary if statement
@OwsleyJr OwsleyJr force-pushed the fix/webpush-verify branch from 4863034 to adb45fc Compare June 25, 2025 02:45
@OwsleyJr OwsleyJr marked this pull request as draft June 26, 2025 03:55
@OwsleyJr OwsleyJr marked this pull request as ready for review June 27, 2025 00:27
@sct sct enabled auto-merge (squash) June 27, 2025 00:39
@sct sct merged commit a1d3977 into develop Jun 27, 2025
8 checks passed
@sct sct deleted the fix/webpush-verify branch June 27, 2025 00:45
OwsleyJr added a commit that referenced this pull request Oct 8, 2025
* fix: verify webpush through the service worker

* fix: prevent permissions check outside of settings

* fix: do not resubscribe if no subscription exists

refactor: added comments for verification

* fix: prevent multiple backend calls

refactor: rename variable for clarity

* fix: subscriptions deleting properly

refactor: move one line of code

fix: add dependency in serviceworker

* fix: prevent deletion of active subscription

fix: add lock icon for better clarity

fix: add i18n language

* fix: convert subscription to json more reliably

refactor: move from consoles to throws

refactor: add error to throw

refactor: remove unnecessary if statement

* refactor: add push subscription function finder

* fix: push active subscription to the top
ThePharmer pushed a commit to ThePharmer/requesterr that referenced this pull request Nov 12, 2025
Syncs fork with upstream Overseerr develop branch, bringing in 18 bug fixes
and improvements from commits 4cc3495..5ef098f.

Key upstream improvements merged:
- fix(api): update Plex Watchlist URL (sct#4220)
- fix: add flag in local storage for notifications (sct#4180)
- fix: add push subscription verification and resubscribe logic (sct#4163)
- fix: better handling for active webpush subscription (sct#4146)
- fix: handle partial seasons more reliably (sct#4116)
- refactor(MediaRequest): consolidate lifecycle hooks (sct#4124)
- Multiple webpush notification improvements
- Media entity cascade fixes
- Various UI and request handling fixes

Conflicts resolved:
- README.md: Preserved Requesterr fork branding and attribution

All Requesterr branding (translations, CSS classes, settings) remains intact.
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants