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)
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
Unknown Object (File)
Fri, Oct 25, 7:19 AM
Unknown Object (File)
Sep 26 2024, 4:13 PM
Unknown Object (File)
Sep 26 2024, 4:10 PM
Unknown Object (File)
Sep 20 2024, 8:01 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