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

Maximum call stack size exceeded rendering three-level data structure in FlatList using @realm/react v0.4.3 #5736

Open
myou11 opened this issue Apr 14, 2023 · 2 comments

Comments

@myou11
Copy link

myou11 commented Apr 14, 2023

How frequently does the bug occur?

Always

Description

Hi, I am having trouble with my app crashing due to rendering too many Realm items in a FlatList. I have a three level deep nested data structure similar to what can be seen in this repo. I modified the project from this previous related issue. In this previous issue, the PR that fixed it made some changes to cachedObject.ts. I am running into an issue with this file in particular. In my internal company project, my app crashes after adding around 60-80 items depending on the device I test on. Here is a picture of the stacktrace. You can see the "Maximum call stack size exceeded while running cachedObjectHandler.get.
realm_call_stack_size_exceeded_flatlist
Unfortunately, I can't reproduce the issue in the repo I linked earlier, but the repo does show a similar three-level data structure (Task -> Subtasks -> SubSubtasks) to my project.
I am able to trigger the crash always by opening the app and adding 60-80 items. The interesting thing is that when I re-open the app, my previous 60-80 items I added before were there and it does not crash until I add another set of 60-80 items in that "session".
I downgraded my app to a version I had previously, before I upgraded my @realm/react from 0.4.1 to 0.4.3. The 0.4.1 version does not encounter this issue. I was able to add 100+ items and no crash. I reinstalled the 0.4.3 version and got the crash like stated earlier.
I'm not sure exactly how to get around this issue other than downgrading to 0.4.1, but I would like the fixes provided by 0.4.3.

Can you please help me take a look into this issue please?

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

realm@11.8.0

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 16

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

@kneth
Copy link
Member

kneth commented Apr 18, 2023

@myou11 Thank you for reporting. It looks like you have found a regression in 0.4.3 but we need to investigate it further.

Your 60-80 items are on the root level, right? How many subtasks and subsubtasks do you have?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Apr 18, 2023
@myou11
Copy link
Author

myou11 commented Apr 18, 2023

In my project, the equivalent to the reproduction repo would be: a Task is always added with at least one Subtask and at least one SubSubtask. For my testing, I only had one Subtask and SubSubtask under each Task, but 60-80 of those units as a whole would be enough to crash the app.

Thank you for taking the time to investigate!

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Apr 18, 2023
@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label May 31, 2023
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

3 participants
@kneth @myou11 and others