Skip to content

Conversation

@bnham
Copy link
Contributor

@bnham bnham commented Aug 20, 2024

dda4650

Delete push subscriptions and terminate IPC connections associated with removed web clips
https://bugs.webkit.org/show_bug.cgi?id=278367
rdar://131367607

Reviewed by Brady Eidson.

This moves the logic from 282260@main (which removed push subscriptions associated with uninstalled
web clips) up one level from PushService to WebPushDaemon. We now check for web clips that are
deleted or associated with obsolete bundle IDs on every IPC and also before firing push events. If
we detect a subscription in an invalid state, then we terminate any associated IPC connections and
also remove the subscriptions from the database. Previously, we were only doing the latter.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/webpushd/PushService.h:
* Source/WebKit/webpushd/PushService.mm:
(WebPushD::PushService::create):
(WebPushD::PushService::PushService):
(WebPushD::PushService::updateSubscriptionSetState):
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(getAllowedBundleIdentifiers):
(getInstalledWebClipIdentifiers):
(webClipExists):
(WebPushD::WebPushDaemon::startPushService):
(WebPushD::WebPushDaemon::connectionEventHandler):
(WebPushD::WebPushDaemon::updateSubscriptionSetState):
(WebPushD::WebPushDaemon::handleIncomingPush):

Canonical link: https://commits.webkit.org/282583@main

d4ce220

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 wincairo-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2
✅ 🛠 tv
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@bnham bnham requested a review from cdumez as a code owner August 20, 2024 03:28
@bnham bnham self-assigned this Aug 20, 2024
@bnham bnham added the WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore). label Aug 20, 2024
@bnham bnham requested a review from beidson August 20, 2024 03:41
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 20, 2024
@bnham bnham removed the merging-blocked Applied to prevent a change from being merged label Aug 20, 2024
@bnham bnham force-pushed the eng/webpushd-update-subscription-set-state branch from d21ec7d to d4ce220 Compare August 20, 2024 16:18
@bnham bnham added the merge-queue Applied to send a pull request to merge-queue label Aug 21, 2024
…th removed web clips

https://bugs.webkit.org/show_bug.cgi?id=278367
rdar://131367607

Reviewed by Brady Eidson.

This moves the logic from 282260@main (which removed push subscriptions associated with uninstalled
web clips) up one level from PushService to WebPushDaemon. We now check for web clips that are
deleted or associated with obsolete bundle IDs on every IPC and also before firing push events. If
we detect a subscription in an invalid state, then we terminate any associated IPC connections and
also remove the subscriptions from the database. Previously, we were only doing the latter.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/webpushd/PushService.h:
* Source/WebKit/webpushd/PushService.mm:
(WebPushD::PushService::create):
(WebPushD::PushService::PushService):
(WebPushD::PushService::updateSubscriptionSetState):
* Source/WebKit/webpushd/WebPushDaemon.h:
* Source/WebKit/webpushd/WebPushDaemon.mm:
(getAllowedBundleIdentifiers):
(getInstalledWebClipIdentifiers):
(webClipExists):
(WebPushD::WebPushDaemon::startPushService):
(WebPushD::WebPushDaemon::connectionEventHandler):
(WebPushD::WebPushDaemon::updateSubscriptionSetState):
(WebPushD::WebPushDaemon::handleIncomingPush):

Canonical link: https://commits.webkit.org/282583@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/webpushd-update-subscription-set-state branch from d4ce220 to dda4650 Compare August 21, 2024 22:41
@webkit-commit-queue
Copy link
Collaborator

Committed 282583@main (dda4650): https://commits.webkit.org/282583@main

Reviewed commits have been landed. Closing PR #32439 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit dda4650 into WebKit:main Aug 21, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WebKit Misc. For miscellaneous bugs in the WebKit framework (and not JavaScriptCore or WebCore).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants