Skip to content

Rerequest push notifications - #4174

Merged
mpivchev merged 3 commits into
masterfrom
push-notif-request
Jul 15, 2026
Merged

Rerequest push notifications#4174
mpivchev merged 3 commits into
masterfrom
push-notif-request

Conversation

@mpivchev

@mpivchev mpivchev commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

NCKit: nextcloud/NextcloudKit#231
Fixes #4145

Rerequest each notification from server so it's up to date. This resolves issue where a notification would show the wrong content.

  • Tested with multiple accounts, 2 accounts from same instance and 1 from a different instance. Notifications behave as usual, but have updated content if needed.
  • Tested NCKit timeout + serviceExtensionTimeWillExpire timeout

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev
mpivchev marked this pull request as ready for review July 9, 2026 11:28
Copilot AI review requested due to automatic review settings July 9, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Notification Service Extension to re-request the full notification payload from the Nextcloud server (using the notification ID from the push payload) so the displayed content is reconstructed for the logged-in user, matching Android/Desktop behavior and addressing issue #4145.

Changes:

  • Decrypt push payload to identify the matching account and extract nid, then fetch the up-to-date notification from the server.
  • Update the delivered notification title/body based on the server response when available.
  • Add a single-delivery guard (OSAllocatedUnfairLock + deliver()) to avoid double-calling the content handler (normal completion vs. time-expiry).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Notification Service Extension/NotificationService.swift
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Comment thread Notification Service Extension/NotificationService.swift

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.

Comment thread Notification Service Extension/NotificationService.swift
Comment thread Notification Service Extension/NotificationService.swift
Comment thread Notification Service Extension/NotificationService.swift
Comment thread Notification Service Extension/NotificationService.swift
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@mpivchev
mpivchev enabled auto-merge (squash) July 13, 2026 13:29
@mpivchev
mpivchev merged commit 9246e70 into master Jul 15, 2026
7 of 9 checks passed
@mpivchev
mpivchev deleted the push-notif-request branch July 15, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push notifications are sometimes not up to date

3 participants