Page MenuHomePhabricator

[web-db] choose storage engine depending on whether database is supported or not
ClosedPublic

Authored by kamil on Apr 27 2023, 7:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 15, 5:29 PM
Unknown Object (File)
Sat, Dec 14, 4:02 PM
Unknown Object (File)
Sat, Dec 14, 4:02 PM
Unknown Object (File)
Sat, Dec 14, 4:02 PM
Unknown Object (File)
Sat, Dec 14, 4:01 PM
Unknown Object (File)
Sat, Dec 14, 3:55 PM
Unknown Object (File)
Mon, Dec 9, 8:38 AM
Unknown Object (File)
Sat, Dec 7, 11:31 AM
Subscribers

Details

Summary

Conditionally use default persist storage API or database depending on whether database is supported or not.

Depends on D7666

Test Plan

Switch to commReduxStorageEngine and test if it works for not supported database

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.Apr 27 2023, 8:00 AM

Wondering if this is the best solution. How about having two separate storage engines, one with only db and one with redux storage? Then we could conditionally set one or the other, but each of them would be a lot simpler.

This revision is now accepted and ready to land.Apr 28 2023, 4:37 AM
web/redux/comm-redux-storage-engine.js
3 ↗(On Diff #25853)

Is this the right import? Do we have to include index in the path?

web/redux/comm-redux-storage-engine.js
3 ↗(On Diff #25853)

We have an ESLint rule that forces this. It can be ignored, but generally prefer to use index.js instead. This is the same import path we use in web/root.js currently