In previous code it was possible to schedule ops on not initialized DB.
Details
- Add sleep after this line.
- Trigger database deletion and right after schedule some ops.
- Make sure there is no Database not initialized error.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
web/database/database-module-provider.js | ||
---|---|---|
55–64 ↗ | (On Diff #34516) | Wasn't the idea to put the CLEAR_SENSITIVE_DATA inside initPromise? |
address review
web/database/database-module-provider.js | ||
---|---|---|
55–64 ↗ | (On Diff #34516) | yeah, I must've messed something while committing changes, thanks |
web/database/database-module-provider.js | ||
---|---|---|
62 ↗ | (On Diff #34713) | Does this line still make sense? schedule calls will throw an error instead of awaiting on the promise, if they happen between this line and the end of the promise. |
65–70 ↗ | (On Diff #34713) | This should probably be moved outside of the promise. Otherwise we are leaving the db in a init state, but we will never change it to something else. If we move it outside of the promise we will probably need to also check clearDatabase in the === initSuccess case. On the other hand maybe this can be removed? Not sure if we expect that call to init wouldn't re-init db if it's already initialized. |
web/database/database-module-provider.js | ||
---|---|---|
62 ↗ | (On Diff #34713) | I think it can be removed, it was necessary in the previous version (before D9109) where we had separate method for clearing database |
65–70 ↗ | (On Diff #34713) |
yeah that makes sense, and good call with that
I think it's better to keep it |