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)
Tue, Nov 5, 9:13 AM
Unknown Object (File)
Tue, Nov 5, 9:13 AM
Unknown Object (File)
Tue, Nov 5, 9:12 AM
Unknown Object (File)
Fri, Nov 1, 4:45 AM
Unknown Object (File)
Fri, Nov 1, 4:10 AM
Unknown Object (File)
Fri, Nov 1, 3:48 AM
Unknown Object (File)
Fri, Nov 1, 3:48 AM
Unknown Object (File)
Fri, Nov 1, 3:41 AM
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*