When DevTools are open in Safari, the database query hangs forever
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
- Create a Flutter web app that uses Drift for local database access.
- Implement a simple query, for example:
Future<List<DataObject>> getData() async {
return await database.select(table).get();
}
- Build and run this Flutter web app locally or deploy it somewhere accessible.
- Open the app in Safari (version 18.3 tested).
- Open the Safari DevTools (e.g., via Develop > Show Web Inspector).
- 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.
Same here +1
+1
Anything glaring in the browser console?
@dickermoshe no, nothing related
Thanks for the report! Was the associated drift worker also from the 2.24.0 release?
@simolus3 yes
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.