-
Notifications
You must be signed in to change notification settings - Fork 78
feat(FR-1562): Setup Relay Subscription for Session Status #4423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(FR-1562): Setup Relay Subscription for Session Status #4423
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
453bfe4 to
71b88e6
Compare
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
|---|---|---|---|
| 🔴 | Statements | 4.43% | 517/11682 |
| 🔴 | Branches | 3.6% | 297/8239 |
| 🔴 | Functions | 2.57% | 92/3577 |
| 🔴 | Lines | 4.4% | 503/11426 |
Test suite run success
118 tests passing in 13 suites.
Report generated by 🧪jest coverage report action from f355e96
71b88e6 to
6d53d71
Compare
There was a problem hiding this 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 GraphQL subscription support using Server-Sent Events (SSE) to enable real-time session status updates, replacing the previous polling-based approach. The implementation adds the graphql-sse client for subscription handling and provides a fallback to polling for older manager versions.
Key changes:
- Integration of
graphql-sselibrary for SSE-based GraphQL subscriptions - Subscription support in Relay environment configuration
- Real-time session status updates via
schedulingEventsBySessionsubscription - Version-aware fallback mechanism for backward compatibility
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| react/src/RelayEnvironment.ts | Added SSE subscription client configuration and integrated it into Relay network layer |
| react/src/components/BAIComputeSessionNodeNotificationItem.tsx | Replaced polling-based status updates with subscription-based approach, with fallback to legacy polling for older versions |
| react/src/components/ComputeSessionNodeItems/SessionStatusTag.tsx | Added visual indicator (CircleAlertIcon) for sessions with status_info and included new transitional statuses (SCHEDULED, PREPARED) |
| react/package.json | Added graphql-sse dependency (v2.6.0) |
| pnpm-lock.yaml | Updated lockfile with graphql-sse package |
| data/schema.graphql | Updated GraphQL schema with subscription types and related infrastructure (extensive schema changes for model deployment features) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
6d53d71 to
3322d20
Compare
13743f3 to
63915b3
Compare
nowgnuesLee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ironAiken2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge activity
|
Resolves #4405 ([FR-1562](https://lablup.atlassian.net/browse/FR-1562)) > [!IMPORTANT] > Currently, the subscription is only applied to the notification shown when a session is created. This PR adds GraphQL subscription support to enable real-time updates for various features: - Implemented GraphQL SSE client for subscription support - Added session status subscription to replace polling-based status updates - Updated session notification components to use subscriptions when available - Added fallback to polling for older manager versions The subscription implementation provides more efficient real-time updates compared to the previous polling approach, reducing unnecessary network requests while providing immediate status changes. [FR-1562]: https://lablup.atlassian.net/browse/FR-1562?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
63915b3 to
f355e96
Compare

Resolves #4405 (FR-1562)
Important
Currently, the subscription is only applied to the notification shown when a session is created.
This PR adds GraphQL subscription support to enable real-time updates for various features:
The subscription implementation provides more efficient real-time updates compared to the previous polling approach, reducing unnecessary network requests while providing immediate status changes.