Page MenuHomePhabricator

[web-db] avoid database init on app start on Safari
ClosedPublic

Authored by kamil on Jun 6 2023, 10:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 10:53 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:48 AM
Unknown Object (File)
Fri, Nov 1, 3:41 AM
Unknown Object (File)
Fri, Oct 25, 11:44 PM
Unknown Object (File)
Oct 22 2024, 9:02 PM
Subscribers

Details

Summary

In general, we establish database connection immediately after app start, on Safari we need to wait for encryption key generated from main thread.
(context)

Depends on D8123

Test Plan

Database should be inited from sqlite-data-handler.js

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:52 AM
kamil added inline comments.
web/database/database-module-provider.js
38 ↗(On Diff #27491)

Naming might be confusing, but at this point database is not supported (we don't have a key to it), it will be supported after main thread will provide encryption key

tomek added inline comments.
web/database/database-module-provider.js
37 ↗(On Diff #27491)

Can we have a const instead of a function that tells if it is Safari? We can avoid having to detect the browser multiple times, as this fact doesn't change through the lifetime of the app.

This revision is now accepted and ready to land.Jun 13 2023, 4:31 AM
web/database/database-module-provider.js
38 ↗(On Diff #27491)

Do we change the status later?

address review

web/database/database-module-provider.js
37 ↗(On Diff #27491)

good point, thanks

38 ↗(On Diff #27491)

yes, in initDBForLoggedInUser()