HomePhabricator
Diffusion Comm 6c35669e5805

[native] introduce error handling to cover cancelled database tasks

Description

[native] introduce error handling to cover cancelled database tasks

Summary:
context: ENG-2139

This code allows handling exceptions generated by canceling tasks (for now only when clearSensitiveData is called.

In the future maybe it will be cleaner and better to rely on the error code to avoid parsing the message but for now it's not possible, rejecting the promise allows passing only string link;

Test Plan:

  1. Build app for both iOS and Android
  2. Add changes with CommCoreModule methods which will simplify testing: D5582
  3. Run code with bot sync and async code when tasks are canceled, surround with try {} catch.. to detect if checkIfTaskWasCancelled works correctly for both.
  4. Check if previous integrations with the database work properly eg. by adding some drafts etc.

Reviewers: marcin, tomek, atul

Reviewed By: marcin, tomek

Subscribers: ashoat, tomek, atul, abosh

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

Details

Provenance
kamilAuthored on Nov 10 2022, 6:32 AM
Reviewer
marcin
Differential Revision
D5594: [native] introduce error handling to cover cancelled database tasks
Parents
rCOMM615b98191857: [native] refactor CommCoreModule to allow cancellable tasks
Branches
Unknown
Tags
Unknown