WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@kiatng
Copy link

@kiatng kiatng commented Nov 27, 2025

Summary

This PR improves the source selection UX and refactors sidecar connection management for better reliability. It is a result of debugging issue #4537, to isolate the problem.

Changes

New Features

  • Immediate feedback on source selection: Users now see immediate UI feedback when selecting a file, before metadata loads
  • New SidecarConnectionManager class: Centralizes sidecar process connection management with proper state handling

Improvements

  • Implement connection state management (CONNECTING, CONNECTED, FAILED, DISCONNECTED)
  • Add UUID-based request correlation to prevent race conditions with concurrent metadata requests
  • Add request timeouts (10s) and connection timeouts (10.5s) with proper cleanup
  • Disable drive selection until full metadata is loaded
  • Enhance error handling with proper cleanup of selection state on errors
  • Fix TypeScript File.path type issue in drag-and-drop handler

Code Quality

  • Reduced lint errors from 7 to 6 (fixed pre-existing File.path TypeScript issue)
  • Clean up legacy code related to spawning child processes and metadata requests
  • Improve error messages

Files Changed

  • lib/gui/app/modules/sidecar-connection.ts (new)
  • lib/gui/app/components/source-selector/source-selector.tsx
  • lib/gui/app/models/selection-state.ts
  • lib/gui/app/models/store.ts
  • lib/gui/app/modules/api.ts
  • lib/gui/app/pages/main/MainPage.tsx
  • lib/gui/app/app.ts
  • lib/util/api.ts

Testing

  • Manual testing of file selection flow
  • Verified immediate UI feedback on source selection
  • Verified proper error handling and state cleanup

- Implement SidecarConnectionManager to handle metadata requests and connection state management

- Enhance source selection handling with immediate feedback and proper error handling

- Update SourceSelector to utilize the new connection manager for requesting metadata

- Enhance MainPage to disable drive selection until full metadata is loaded

- Improve error handling and connection management in SidecarConnectionManager and API module

- Remove unnecessary console logs and improve error messages for better debugging

- Enhance handling of pending requests to ensure robustness against multiple requests

- Disable DriverlessDeviceAdapter on Windows to prevent WebSocket message handling issues in the sidecar process

- Clean up legacy code related to spawning child processes and metadata requests

- Ensure proper cleanup of selection state on errors during source selection
@flowzone-app
Copy link
Contributor

flowzone-app bot commented Nov 27, 2025

A repository maintainer needs to approve these workflow run(s).

To approve, maintainers can either:

Submit an approval review on this pull request, OR

Submit a review comment starting with /deploy

Then re-run the failed job(s) via the Checks tab above.

Reviews must be on the specific commit SHA of the workflow run to be considered.

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