BlockNote
BlockNote copied to clipboard
Infinite loop if UserStore can't find a user
Describe the bug
If the UserStore does not contain a set of user IDs, it attempts to resolve them
Unless the resolver does not throw an error when it can't resolve a particular ID, update is emitted
The emitted update causes the useUsers hook to load the users again
It is probably a rare occasion, but nevertheless, it might happen and potentially freeze the app.
To Reproduce
- visit the below Stackblitz
- open the browser console
- add a comment as
John Doe - click onto the commented text to open the thread
- see
resolvingbeing logged repeatedly
https://stackblitz.com/github/milanpoliak/BlockNote/tree/load-users-loop/examples/07-collaboration/04-comments?file=App.tsx