Skip to content

Conversation

@dkhalife
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 23, 2025 18:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements WebSocket-based request/response infrastructure controlled by a new sendViaWebsocket feature flag. When enabled (and WebSocket is connected), API requests are sent via WebSocket instead of HTTP, maintaining backward compatibility through a transport abstraction layer.

Key changes:

  • Added sendViaWebsocket feature flag and transport abstraction layer that conditionally routes requests through WebSocket or HTTP
  • Implemented request/response pattern in WebSocketManager with timeout handling, pending request tracking, and error handling
  • Migrated all API endpoints (tasks, labels, tokens, notifications) to use the transport layer with corresponding WebSocket action definitions
  • Changed token ID type from string to number for consistency across the codebase

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
frontend/src/constants/featureFlags.ts Added new sendViaWebsocket feature flag definition
frontend/test/constants/featureFlags.test.ts Updated test to include the new feature flag
frontend/src/api/transport.ts New transport abstraction that routes requests to WebSocket or HTTP based on feature flag and connection state
frontend/src/utils/websocket.ts Added request/response handling with pending request tracking, timeout management, and error handling
frontend/src/models/websocket.ts Extended WebSocket action/payload definitions for all API operations and updated token ID types to number
frontend/src/api/tasks.ts Migrated all task endpoints to use transport layer with WebSocket support
frontend/src/api/labels.ts Migrated all label endpoints to use transport layer with WebSocket support
frontend/src/api/tokens.ts Migrated all token endpoints to use transport layer with WebSocket support, updated token ID type to number
frontend/src/api/users.ts Migrated notification settings endpoint to use transport layer with WebSocket support
frontend/src/utils/marshalling.ts Made MarshallLabels generic to work with both Task and Omit<Task, 'id'> types
frontend/src/models/token.ts Changed token ID type from string to number and added optional scopes field
frontend/src/store/tokensSlice.ts Updated deleteToken parameter type from string to number
frontend/src/views/Settings/APITokenSettings.tsx Updated token ID types from string to number

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dkhalife dkhalife enabled auto-merge (squash) December 23, 2025 19:37
@dkhalife dkhalife merged commit 63440f4 into main Dec 23, 2025
7 checks passed
@dkhalife dkhalife deleted the usewsforreq branch December 23, 2025 19:37
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.

2 participants