Skip to content

Infinite loop if UserStore can't find a user #1548

Open
@milanpoliak

Description

@milanpoliak

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 resolving being logged repeatedly

https://stackblitz.com/github/milanpoliak/BlockNote/tree/load-users-loop/examples/07-collaboration/04-comments?file=App.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood advanced issueGood for experienced contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions