Skip to content

Fix cancelStaticNotification never actually cancelling the notification#25519

Draft
Copilot wants to merge 3 commits intotrunkfrom
copilot/sub-pr-25517
Draft

Fix cancelStaticNotification never actually cancelling the notification#25519
Copilot wants to merge 3 commits intotrunkfrom
copilot/sub-pr-25517

Conversation

Copy link
Copy Markdown

Copilot AI commented May 4, 2026

cancelStaticNotification was calling getPendingNotificationRequests but discarding the result and never removing anything — the static weekly-roundup notification remained scheduled regardless.

Change

Replace the no-op async fetch with a direct call to removePendingNotificationRequests(withIdentifiers:):

// Before – fetches requests, does nothing with them
func cancelStaticNotification(completion: @escaping (Bool) -> Void = { _ in }) {
    userNotificationCenter.getPendingNotificationRequests { _ in
        completion(true)
    }
}

// After – actually removes the notification
func cancelStaticNotification(completion: @escaping (Bool) -> Void = { _ in }) {
    userNotificationCenter.removePendingNotificationRequests(withIdentifiers: [staticNotificationIdentifier])
    completion(true)
}

removePendingNotificationRequests is synchronous, so the async closure is no longer needed.

mokagio and others added 2 commits May 4, 2026 12:46
Adds `unused_closure_parameter` to `.swiftlint.yml`'s `only_rules` and
applies SwiftLint's autocorrection across the codebase.
340 violations were autofixed across 167 files; no manual fixes or
`swiftlint:disable` comments were needed.

Part of the Orchard SwiftLint rollout campaign.

---

Generated with the help of Claude Code, https://claude.com/claude-code

Co-Authored-By: Claude Code Opus 4.7 (1M context) <noreply@anthropic.com>
@dangermattic
Copy link
Copy Markdown
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Copilot AI changed the title [WIP] [WIP] Address feedback on enabling SwiftLint rule: unused_closure_parameter Fix cancelStaticNotification never actually cancelling the notification May 4, 2026
Copilot finished work on behalf of mokagio May 4, 2026 04:08
Copilot AI requested a review from mokagio May 4, 2026 04:08
@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number32091
VersionPR #25519
Bundle IDorg.wordpress.alpha
Commit5d6738c
Installation URL67ghjugs5h1p0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number32091
VersionPR #25519
Bundle IDcom.jetpack.alpha
Commit5d6738c
Installation URL0u04laarfii80
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from mokagio/swiftlint-unused-closure-parameter to trunk May 5, 2026 05:00
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.

4 participants