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
Open
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.