<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>296773</bug_id>
          
          <creation_ts>2025-07-31 15:30:56 -0700</creation_ts>
          <short_desc>Having `&quot;app_badge&quot;: 1` in Declarative Web Push payload causes crash</short_desc>
          <delta_ts>2025-08-26 08:23:05 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>Safari 26</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=296770</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kagami Sascha Rosylight">krosylight</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>willian</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2133738</commentid>
    <comment_count>0</comment_count>
    <who name="Kagami Sascha Rosylight">krosylight</who>
    <bug_when>2025-07-31 15:30:56 -0700</bug_when>
    <thetext>```json
{
    &quot;web_push&quot;: 8030,
    &quot;notification&quot;: {
        &quot;title&quot;: &quot;Webkit.org — Meet Declarative Web Push&quot;,
        &quot;lang&quot;: &quot;en-US&quot;,
        &quot;dir&quot;: &quot;ltr&quot;,
        &quot;body&quot;: &quot;Send push notifications without JavaScript or service worker!&quot;,
        &quot;navigate&quot;: &quot;https://webkit.org/blog/16535/meet-declarative-web-push/&quot;,
        &quot;silent&quot;: false,
        &quot;app_badge&quot;: &quot;1&quot;
    }
}
```

First of all `app_badge` should actually be the top level member instead of from `notification`. (See also bug 296770.) Anyway:

1. Open https://mozilla-services.github.io/WebPushDataTestPage/?restricted
2. Subscribe, encrypt, add VAPID with an email address
3. Copypaste the generated curl command to terminal

Doing so shows a notification and then causes crash:

```
Application Specific Backtrace 0:
0   CoreFoundation                      0x0000000196b86ca0 __exceptionPreprocess + 176
1   libobjc.A.dylib                     0x000000019664ab90 objc_exception_throw + 88
2   Foundation                          0x0000000198109d74 -[NSVariableExpression isEqual:] + 0
3   Foundation                          0x0000000198109c64 +[NSBundle bundleWithURL:] + 32
4   Safari                              0x00000001c9760e30 -[AppController websiteDataStore:workerOrigin:updatedAppBadge:] + 264
5   WebKit                              0x00000001bd7d7a88 _ZN22WebsiteDataStoreClient21workerUpdatedAppBadgeERKN7WebCore18SecurityOriginDataENSt3__18optionalIyEE + 212
6   WebKit                              0x00000001bdd8dfc4 _ZZN6WebKit16WebsiteDataStore18processPushMessageEONS_14WebPushMessageEON3WTF17CompletionHandlerIFvbEEEEN3$_0clEbONSt3__18optionalIN7WebCore19NotificationPayloadEEE + 496
7   WebKit                              0x00000001bdd8dc54 _ZN6WebKit16WebsiteDataStore18processPushMessageEONS_14WebPushMessageEON3WTF17CompletionHandlerIFvbEEE + 312
8   WebKit                              0x00000001bd7c43c0 -[WKWebsiteDataStore(WKPrivate) _processPushMessage:completionHandler:] + 120
9   Safari                              0x00000001c975fcc4 -[AppController _processPushMessages:inDataStore:completionHandler:] + 308
10  Safari                              0x00000001c975fb40 __61-[AppController _fetchAndProcessPushesWithCompletionHandler:]_block_invoke + 132
11  WebKit                              0x00000001bd7d93d0 _ZN3WTF6Detail15CallableWrapperIZ57-[WKWebsiteDataStore(WKPrivate) _getPendingPushMessages:]E5$_151vJRKNS_6VectorIN6WebKit14WebPushMessageELm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEEE4callESA_ + 228
12  WebKit                              0x00000001bdd68a30 _ZN3WTF6Detail15CallableWrapperIZN3IPC10Connection31makeAsyncReplyCompletionHandlerIN8Messages14NetworkProcess22GetPendingPushMessagesENS_17CompletionHandlerIFvRKNS_6VectorIN6WebKit14WebPushMessageELm0ENS_15CrashOnOverflowELm16ENS_10FastMallocEEEEEEEENS8_IFvPNS2_7DecoderEEEEOT0_NS_19ThreadLikeAssertionEEUlSK_E_vJSK_EE4callESK_ + 112
13  WebKit                              0x00000001bdbbb238 _ZN3WTF6Detail15CallableWrapperIZN6WebKit21AuxiliaryProcessProxy11sendMessageEONS_9UniqueRefIN3IPC7EncoderEEENS_9OptionSetINS5_10SendOptionEEENSt3__18optionalINS5_27ConnectionAsyncReplyHandlerEEENS3_35ShouldStartProcessThrottlerActivityEE3$_1vJPNS5_7DecoderEEE4callESJ_ + 64
14  WebKit                              0x00000001be25251c _ZN3IPC10Connection15dispatchMessageEN3WTF9UniqueRefINS_7DecoderEEE + 436
15  WebKit                              0x00000001be255e24 _ZN3WTF6Detail15CallableWrapperIZN3IPC10Connection22enqueueIncomingMessageENS_9UniqueRefINS2_7DecoderEEEE3$_2vJEE4callEv + 132
16  JavaScriptCore                      0x00000001b58d424c _ZN3WTF7RunLoop11performWorkEv + 524
17  JavaScriptCore                      0x00000001b58d50e8 _ZN3WTF7RunLoop11performWorkEPv + 36
18  CoreFoundation                      0x0000000196b15cd4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
19  CoreFoundation                      0x0000000196b15c68 __CFRunLoopDoSource0 + 172
20  CoreFoundation                      0x0000000196b159d4 __CFRunLoopDoSources0 + 232
21  CoreFoundation                      0x0000000196b14628 __CFRunLoopRun + 840
22  CoreFoundation                      0x0000000196b13c58 CFRunLoopRunSpecific + 572
23  HIToolbox                           0x00000001a25a827c 
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2134043</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2025-08-02 11:50:37 -0700</bug_when>
    <thetext>Thank you for the report! 

I&apos;m not 100% certain, but from the stack trace, this seems more likely to be a Safari issue, not a WebKit one. For now I&apos;ll mark this as MOVED, and will let the Safari team know.

rdar://133736557</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2138821</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2025-08-26 08:23:05 -0700</bug_when>
    <thetext>*** Bug 297907 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>