-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
SDK FY21-Q2
-
2893
Goals
Currently I'm having the following issue:
- when I try to delete an object the delete operation fails
- when I'm in debugging the delete works as intendend
- the code is also very easy, low complexity
<!--- What are you trying to achieve? -->
Expected Results
Deletion succesfull
Actual Results
<!--- What happened instead? -->
<!--- e.g. the stack trace of a crash -->
Steps to Reproduce
No ideea, basically delete something ?
Code Sample
This is the model definition
export class Routine { static schema = { name: 'Routine', primaryKey: 'id', properties: { id: 'string', name: 'string', exercises: 'Exercise[]', }, }; id: string; name: string; exercises: Exercise[]; }
This is the actual deletion
const routines = realm.objects<Routine>(Routine); const routine = routineId ? routines.find((r) => r.id === routineId) : undefined; const [name, setName] = useState<string>(routine?.name ?? ''); const handleDelete = useCallback(() => { const navigate = () => { realm.write(() => { realm.delete(routine); }); navigation.pop(); }; if (routine.exercises.length === 0) { navigate(); } }
Version of Realm and Tooling
- Realm JS SDK Version: 6.0.1
- Node or React Native: React Native 0.61.5
- Client OS & Version: MacOS Mojave 10.14.6
- Which debugger for React Native: ?/ React Native Debuger
Also, as I know that this claim is pretty bold, here's a zip file containing a video with the error happening and not happening when debugging is on
tapastimer-repro.mov.zip