feat(desktop): generate ports.json in setup and fix static ports watcher#1479
Conversation
Setup script now generates .superset/ports.json with human-readable labels for all allocated ports. Also fixes the static ports subscription which was passing an empty workspaceId, causing the file watcher to never start.
📝 WalkthroughWalkthroughThis pull request adds port management functionality by introducing a ports.json generation mechanism in the setup script, adding a global subscription endpoint for port changes across all workspaces in the TRPC router, and updating the frontend hook to use this new global subscription instead of per-workspace subscriptions. Changes
Sequence DiagramsequenceDiagram
participant Client as Renderer Hook
participant Server as TRPC Router
participant Watchers as Workspace Watchers
Client->>Server: Subscribe to subscribeAllStatic
Server->>Watchers: Initialize watchers for all workspaces
Watchers-->>Server: Ready
Server-->>Client: Subscription active
Note over Watchers: Monitor workspace port changes
Watchers->>Server: Port change detected
Server->>Client: Emit {type: "change", workspaceId}
Client->>Client: Invalidate getAllStatic cache
Client->>Server: Unsubscribe
Server->>Watchers: Unwatch all workspaces
Watchers-->>Server: Cleanup complete
Server-->>Client: Subscription closed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Setup script now generates .superset/ports.json with human-readable labels for all allocated ports. Also fixes the static ports subscription which was passing an empty workspaceId, causing the file watcher to never start.
Description
Related Issues
Type of Change
Testing
Screenshots (if applicable)
Additional Notes
Summary by CodeRabbit
Release Notes