Hi Peeps,
I've experiencing an issue where DataStore.clear() does not seem to complete successfully in react-native. Even after calling await DataStore.clear(), I still encounter the following error when trying to observe data:
Error: DataStoreStateError: Tried to execute DataStore.observe() while DataStore was "Clearing".
This can only be done while DataStore is "Started" or "Stopped". To remedy:
Ensure all calls to stop() and clear() have completed first.
If this is not possible, retry the operation until it succeeds., js engine: hermes
Steps We Have Taken to Resolve the Issue:
- Awaiting DataStore.clear() Before Restarting
- Implementing a Retry Mechanism
- Using DataStore.stop() Before Clearing
DataStore.clear() appears to hang in the "Clearing" state indefinitely, preventing any further DataStore operations.
Is there any known issue with DataStore.clear() not completing? Are there additional steps we should take to ensure clear() fully executes before restarting DataStore?
Kindly assist
Thanks.