Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native app crashes when realm.delete(toDelete) is called multiple times or spammed #6978

Open
ahmadhannan-ammag opened this issue Feb 21, 2025 · 0 comments

Comments

@ahmadhannan-ammag
Copy link

my app crashes when this method is called concurrently. Here is my code:

const removeTokenFromRealm = useCallback(
(walletId: string, assetId: string) => {
const toDelete = realm.objects(REALM_TYPE_TOKEN).filtered('walletId = $0 AND assetId = $1', walletId, assetId);

  realm.write(() => {
    try {
      console.log('to delete ', realm.delete);
      realm.delete(toDelete);
    } catch (error) {
      console.log('error deleting token', error);
    }
  })
  
},
[realm],

);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant