Skip to content

fix: stale closure bug and race condition, clean up dead code, update docs and branding#102

Open
Mohammad-Faiz-Cloud-Engineer wants to merge 5 commits into
kil0bit-kb:mainfrom
Mohammad-Faiz-Cloud-Engineer:main
Open

fix: stale closure bug and race condition, clean up dead code, update docs and branding#102
Mohammad-Faiz-Cloud-Engineer wants to merge 5 commits into
kil0bit-kb:mainfrom
Mohammad-Faiz-Cloud-Engineer:main

Conversation

@Mohammad-Faiz-Cloud-Engineer

Copy link
Copy Markdown

This PR fixes a nasty stale closure bug in connectDevice where the refresh guard would silently block because React was holding onto an old value. Added a force param to bypass it properly.

Also squashed a race condition on mount. There were two separate effects checking scrcpy and refreshing devices one in useScrcpy init and another in App.tsx both fighting with different scrcpyPath values. Consolidated them into a single post init effect so they stop stepping on each other.

Cleaned out a bunch of dead weight removed unused Rust commands like greet, get_mdns_devices, and adb_shell, plus a dead localStorage key that was never read. Also synced the flake.nix version to match.

On the docs side rewrote GUIDE.md and README.md to be more useful and less bloated. Cut almost 90 lines of noise.
Bumped the version to v4.0.1 and updated the icon and banner to match the new branding.

…ove dead code

- Add orce param to refreshDevices to bypass stale closure guard
  in connectDevice where setIsRefreshing(false) + refreshDevices()
  could be silently blocked due to React closure capturing old value
- Remove duplicate checkScrcpy/refreshDevices mount effects (one in
  useScrcpy init, one in App.tsx) racing with different scrcpyPath
  values; consolidate into single post-init effect
- Remove dead Rust commands: greet, get_mdns_devices, adb_shell
- Remove dead localStorage key scrcpy_record_path (never read)
- Sync flake.nix version to 4.0.1
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.

1 participant