Page MenuHomePhabricator

[web] initialize `localforage` on main thread
ClosedPublic

Authored by kamil on Jun 6 2023, 10:07 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 9:25 PM
Unknown Object (File)
Wed, Apr 17, 9:25 PM
Unknown Object (File)
Wed, Apr 17, 9:25 PM
Unknown Object (File)
Wed, Apr 17, 9:23 PM
Unknown Object (File)
Thu, Apr 4, 9:00 AM
Unknown Object (File)
Mar 5 2024, 11:54 PM
Unknown Object (File)
Mar 5 2024, 11:54 PM
Unknown Object (File)
Mar 5 2024, 9:27 PM
Subscribers

Details

Summary

On Safari we need to persist key from main thread. (context)

Depends on D8116

Test Plan
  1. Try to add data to indexedDB from main thread
  2. Check in database on worker still works

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Jun 7 2023, 1:29 AM
tomek added inline comments.
web/database/worker/db-worker.js
53 ↗(On Diff #27484)

Should we still call it here? Or is calling just from root is enough?

This revision is now accepted and ready to land.Jun 13 2023, 3:17 AM
web/database/worker/db-worker.js
53 ↗(On Diff #27484)

Main thread and worker thread have different contexts and because of that (probably, as docs do not cover this) also have different localforage instances. Without calling this in both places, one place will use comm indexedDB instance and the second one will use the default one which is called localfoarge-*host*