HomePhabricator
Diffusion Comm b60e970b0d46

Introduce and implement 'clearSensitiveData' method in DetabaseQueryExecutor…

Description

Introduce and implement 'clearSensitiveData' method in DetabaseQueryExecutor and SQLiteQueryExecutor

Summary: This differential introduces method to clean Secure Store and SQLite to 'DatabaseQueryExecutor' API and implements it in its derived class 'SQLiteQueryExecutor'. This method firstly attempts to delete database (if it exists), iverwrite encryption key in secure store and finally run migrate' method to create new database. The last step is essential. This method is expected to be called from react component, so it is important that it leaves application in a state that other components can use. In particular core-data-provider` component tries to do some database queries even if the user is logged out.

Test Plan: This function is not expected to be used outside of react-component so it might be hard to provide test plan prior to introducing diffs that implement actual components. But for the purpose of unit testing, someone might: 1) place this function somwhere in AppDelegate 2) open the app without any user logged in 3) execute this function setp by step in the debugger and monitor database file size.

Reviewers: tomek, atul, jon

Reviewed By: tomek, atul

Subscribers: ashoat, adrian, abosh

Differential Revision: https://phab.comm.dev/D4728