Skip to content

Conversation

@doums
Copy link
Contributor

@doums doums commented Oct 30, 2025

  1. Fix a potential infinite loop of React renders occurring in the Node component.
    Seems related to the usage of useDeferredValue. I failed to understand why but when I drop useDeferredValue(...) it fixes the issue. At least I was not able to reproduce.

For performance optimization, switched to debounce to render the list while typing into the search input.
This also fix the scrollToNode while navigating back to the server list and focusing the previous focused node.

  1. Fix incorrect types on JS kv API

EDIT: updated react to latest version fixed the loop issue with useDeferredValue -> rollbacked 1.


This change is Reviewable

drop useDeferredValue, it seems to be the cause of this render loop
switch to debounce mechanism
@agentpietrucha
Copy link
Contributor

Where did you drop the useDefferedValue? I can't see it in the PR diff

@doums
Copy link
Contributor Author

doums commented Oct 30, 2025

@agentpietrucha it is useDeferredValue, I made a typo in the PR desc
In Node.tsx component

@doums doums changed the title fix(tauri): react infinite render loop fix(tauri): react infinite render loop and kv types and js kv types Oct 30, 2025
Light copy update
@pronebird
Copy link
Collaborator

@doums asked to hold off with merging this for now.

@doums
Copy link
Contributor Author

doums commented Oct 31, 2025

Okay, thanks to @agentpietrucha for testing and pointing this out: useDeferredValue infinite loop was related to this upstream issue and it has received several fixes with the latest React version https://react.dev/blog/2025/10/01/react-19-2#changelog

Updated React to latest (including the hook fixes) fixed the infinite loop we were experiencing.
Let's roll back to it because it is better than using debounce mechanism to improve the list rendering performances.

@doums doums merged commit c8d794d into release/2025.17-fig Oct 31, 2025
10 checks passed
@doums doums deleted the pierre/loopofdeath branch October 31, 2025 10:48
doums added a commit that referenced this pull request Oct 31, 2025
* fix(tauri): react infinite render loop and kv types and js kv types (#3823)

* chore(tauri): update package-lock.json (#3834)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants