drift icon indicating copy to clipboard operation
drift copied to clipboard

When DevTools are open in Safari, the database query hangs forever

Open eeeedgar opened this issue 10 months ago • 7 comments

When the Safari DevTools are open, a database query hangs indefinitely. Closing the DevTools in Safari (or using any other browser) makes the query run as expected.

Environment

  • Safari version: 18.3
  • Flutter web with Drift (2.24.0)
  • Problem is reproducible only in Safari with open DevTools.

Steps to Reproduce

  1. Create a Flutter web app that uses Drift for local database access.
  2. Implement a simple query, for example:
Future<List<DataObject>> getData() async {
    return await database.select(table).get();
}
  1. Build and run this Flutter web app locally or deploy it somewhere accessible.
  2. Open the app in Safari (version 18.3 tested).
  3. Open the Safari DevTools (e.g., via Develop > Show Web Inspector).
  4. Refresh the page so that the query runs once again on load.

This method is executed in the Data Access Layer once when the page is refreshed.

Additional Notes

  • No errors or warnings appear in the console when the query hangs.
  • Other browsers (Chrome, Firefox, Edge) do not exhibit this behavior, even with their DevTools open.
  • The issue arises consistently on every page refresh when Safari DevTools is open.

eeeedgar avatar Jan 30 '25 11:01 eeeedgar

Same here +1

JPGmooder avatar Jan 30 '25 12:01 JPGmooder

+1

MaximKuzin862 avatar Jan 30 '25 12:01 MaximKuzin862

Anything glaring in the browser console?

dickermoshe avatar Feb 03 '25 00:02 dickermoshe

@dickermoshe no, nothing related

eeeedgar avatar Feb 03 '25 16:02 eeeedgar

Thanks for the report! Was the associated drift worker also from the 2.24.0 release?

simolus3 avatar Feb 03 '25 16:02 simolus3

@simolus3 yes

eeeedgar avatar Feb 04 '25 15:02 eeeedgar

Can you reproduce this with new drift project? I tried reproducing this with the examples/web_worker_example/ project in this repository, but the query stream keeps working with the console open in Safari.

simolus3 avatar Feb 05 '25 17:02 simolus3