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)
Mon, Nov 25, 8:50 PM
Unknown Object (File)
Sat, Nov 23, 11:44 AM
Unknown Object (File)
Sat, Nov 23, 8:46 AM
Unknown Object (File)
Sat, Nov 23, 6:43 AM
Unknown Object (File)
Sat, Nov 2, 1:01 AM
Unknown Object (File)
Sat, Nov 2, 1:01 AM
Unknown Object (File)
Sat, Nov 2, 1:01 AM
Unknown Object (File)
Sat, Nov 2, 12:55 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
No Lint Coverage
Unit
No Test Coverage

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