<?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>315804</bug_id>
          
          <creation_ts>2026-05-28 16:44:03 -0700</creation_ts>
          <short_desc>A `readwrite` IDBTransaction never fires oncomplete, onerror, or onabort after the user subscribes to web push in an installed PWA.</short_desc>
          <delta_ts>2026-05-30 13:36:13 -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>Website Storage</component>
          <version>Safari 26</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>sherwinhb</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>nham</cc>
    
    <cc>sherwinhb</cc>
    
    <cc>sihui_liu</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2215531</commentid>
    <comment_count>0</comment_count>
    <who name="">sherwinhb</who>
    <bug_when>2026-05-28 16:44:03 -0700</bug_when>
    <thetext>WHAT&apos;S HAPPENING
================
In an installed PWA (Add to Home Screen, display: standalone) on iOS 26, after the user subscribes to web push and then navigates to another same-origin page and back, the first `readwrite` IDBTransaction the page tries to open on one specific object store never completes. Reads on the same store still work, and reads/writes on other stores in the same database still work -- only `readwrite` on that one store is affected.

Specifically:

  - db.transaction(&apos;Options&apos;, &apos;readwrite&apos;) returns an IDBTransaction normally.
  - tx.objectStore(&apos;Options&apos;).put(value) returns an IDBRequest normally.
  - The request&apos;s onsuccess and onerror never fire.
  - The transaction&apos;s oncomplete, onerror, and onabort never fire.
  - The database connection&apos;s onclose never fires.
  - After about 30 minutes the request finally resolves on its own, which I&apos;m guessing is some internal timer aborting the transaction.

If the page re-opens the database from scratch (indexedDB.open() -&gt; fresh IDBDatabase), the new connection has the same behavior on that one store. So it&apos;s not a stale connection or proxy on the JS side.

Opening a *different* IndexedDB database at the same origin and doing the same `readwrite` `put` works fine -- completes in about 11 ms. So the origin&apos;s IDB pipeline is healthy overall; it&apos;s just this one (database, object store, `readwrite`) combination that stops responding.

Other things to note while the page is sitting there waiting:

  - All other JS keeps running normally -- timers fire, fetch works, the service worker stays responsive.
  - The service worker reports no open IDB transactions of its own.
  - The behavior continues even after the SW has been idle long enough for iOS to terminate it.

So as far as I can tell it&apos;s not the SW holding anything open either.


STEPS TO REPRODUCE
==================
1. On an iPhone (iOS 26), install a PWA that uses IndexedDB and the Push API.
2. From inside the PWA, navigate from page A to page B and back to page A. Confirm IndexedDB writes complete normally on both visits.
3. From inside the PWA, subscribe to push notifications (the page calls pushManager.subscribe() and the user grants permission).
4. Navigate to page B, then back to page A.
5. On step 4&apos;s return to page A, observe that the first `readwrite` `put` on a particular object store never fires any IDB lifecycle event.

A working reproduction (two-page sandbox, dev server, ngrok instructions, expected vs. broken console output) is checked into this PR:

  https://github.com/OneSignal/OneSignal-Website-SDK/pull/1468

Full repro steps are in this comment:

  https://github.com/OneSignal/OneSignal-Website-SDK/pull/1468#issuecomment-4568334180

Steps 1-4 above are the only IDB-relevant trigger; everything else is just plumbing to expose a local HTTPS server to a real device.


WHAT I TRIED
============
  - Calling indexedDB.open() again before the affected `put`. Same behavior on the new connection.
  - Performing the same `readwrite` `put` on a separate database (indexedDB.open(&apos;different-db&apos;, 1)). Completes in ~11 ms.
  - Waiting for the service worker to go idle. Behavior persists.
  - Reads on the affected database/store keep working throughout.


NOTES
=====
  - Only tested in the installed PWA case (display: standalone). I haven&apos;t tried to reproduce it in a regular Mobile Safari tab.
  - Symptom looks similar in shape to bug 226547 (silent indefinite hang with no events), but that one was on indexedDB.open() and was fixed in 14.6.
  - Probably unrelated to the connection-lost family (bug 273827, bug 277615, bug 309386), since we never get a close event or an UnknownError -- the request just never resolves.

See Also: bug 226547, bug 309386

Happy to provide a sysdiagnose if helpful -- please let me know.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>