Skip to content

Conversation

@yomybaby
Copy link
Member

@yomybaby yomybaby commented Oct 21, 2025

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:

  • 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.

Copy link
Member Author

yomybaby commented Oct 21, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added the size:XL 500~ LoC label Oct 21, 2025
@yomybaby yomybaby force-pushed the feat/FR-1562-relay-subacription-environment branch 3 times, most recently from 453bfe4 to 71b88e6 Compare November 18, 2025 14:12
@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Coverage report for ./react

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

@yomybaby yomybaby force-pushed the feat/FR-1562-relay-subacription-environment branch from 71b88e6 to 6d53d71 Compare November 18, 2025 14:21
@yomybaby yomybaby changed the title feat(FR-1562): Setup Relay Subscription Environment feat(FR-1562): Setup Relay Subscription for Session Status Nov 18, 2025
@yomybaby yomybaby marked this pull request as ready for review November 18, 2025 14:27
Copilot AI review requested due to automatic review settings November 18, 2025 14:27
Copilot finished reviewing on behalf of yomybaby November 18, 2025 14:30
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 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-sse library for SSE-based GraphQL subscriptions
  • Subscription support in Relay environment configuration
  • Real-time session status updates via schedulingEventsBySession subscription
  • 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

@yomybaby yomybaby force-pushed the feat/FR-1562-relay-subacription-environment branch from 6d53d71 to 3322d20 Compare November 18, 2025 14:34
@yomybaby yomybaby force-pushed the feat/FR-1562-relay-subacription-environment branch from 13743f3 to 63915b3 Compare November 19, 2025 05:53
@yomybaby yomybaby requested a review from nowgnuesLee November 19, 2025 05:54
Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

LGTM

@graphite-app
Copy link

graphite-app bot commented Nov 19, 2025

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
@graphite-app graphite-app bot force-pushed the feat/FR-1562-relay-subacription-environment branch from 63915b3 to f355e96 Compare November 19, 2025 07:36
@graphite-app graphite-app bot merged commit f355e96 into main Nov 19, 2025
11 checks passed
@graphite-app graphite-app bot deleted the feat/FR-1562-relay-subacription-environment branch November 19, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup Relay Subscription Environment

4 participants