Skip to content

Commit

Permalink
[native] Remove extraneous SQLite deletion alerts
Browse files Browse the repository at this point in the history
Summary:
Context on Linear: https://linear.app/comm/issue/ENG-5165/remove-extraneous-alerts-from-native-app

Removing these alerts since they're mostly noise at this point and can make working with iOS in Simulator pretty frustrating.

Could also maybe improve situation w/ https://linear.app/comm/issue/ENG-5160/fix-sqlitedatahandler-re-renders

Test Plan: `native` app continues to work as expected. Confirmed that things still work as expected by observing the logging I added to replace Alerts.

Reviewers: tomek, ginsu, rohan, kamil

Reviewed By: rohan

Subscribers: ashoat, wyilio

Differential Revision: https://phab.comm.dev/D9522
  • Loading branch information
atulsmadhugiri committed Oct 19, 2023
1 parent 8f7e36e commit c657658
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions native/data/sqlite-data-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,23 +85,15 @@ function SQLiteDataHandler(): React.Node {

const callClearSensitiveData = React.useCallback(
async (triggeredBy: string) => {
if (staffCanSee || staffUserHasBeenLoggedIn) {
Alert.alert('Starting SQLite database deletion process');
}
await commCoreModule.clearSensitiveData();
try {
await filesystemMediaCache.clearCache();
} catch {
throw new Error('clear_media_cache_failed');
}
if (staffCanSee || staffUserHasBeenLoggedIn) {
Alert.alert(
'SQLite database successfully deleted',
`SQLite database deletion was triggered by ${triggeredBy}`,
);
}
console.log(`SQLite database deletion was triggered by ${triggeredBy}`);
},
[staffCanSee, staffUserHasBeenLoggedIn],
[],
);

const handleSensitiveData = React.useCallback(async () => {
Expand Down

0 comments on commit c657658

Please sign in to comment.