fix(FR-2899): disable session row actions on access key mismatch#7424
Open
yomybaby wants to merge 3 commits into
Open
fix(FR-2899): disable session row actions on access key mismatch#7424yomybaby wants to merge 3 commits into
yomybaby wants to merge 3 commits into
Conversation
Member
Author
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. |
Contributor
Coverage Report for react-coverage (./react)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR attempts to prevent session actions from surfacing backend 403 errors when the selected access key differs from the key used to create a session.
Changes:
- Adds access-key mismatch detection and disables affected
SessionActionButtons. - Replaces action tooltips with an explanatory i18n message when mismatch applies.
- Adds
session.AccessKeyMismatchTooltiptranslations across locale files.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
react/src/components/ComputeSessionNodeItems/SessionActionButtons.tsx |
Adds mismatch gating and tooltip routing for session actions. |
resources/i18n/en.json |
Adds English tooltip text. |
resources/i18n/de.json |
Adds German tooltip text. |
resources/i18n/el.json |
Adds Greek tooltip text. |
resources/i18n/es.json |
Adds Spanish tooltip text. |
resources/i18n/fi.json |
Adds Finnish tooltip text. |
resources/i18n/fr.json |
Adds French tooltip text. |
resources/i18n/id.json |
Adds Indonesian tooltip text. |
resources/i18n/it.json |
Adds Italian tooltip text. |
resources/i18n/ja.json |
Adds Japanese tooltip text. |
resources/i18n/ko.json |
Adds Korean tooltip text. |
resources/i18n/mn.json |
Adds Mongolian tooltip text. |
resources/i18n/ms.json |
Adds Malay tooltip text. |
resources/i18n/pl.json |
Adds Polish tooltip text. |
resources/i18n/pt-BR.json |
Adds Brazilian Portuguese tooltip text. |
resources/i18n/pt.json |
Adds Portuguese tooltip text. |
resources/i18n/ru.json |
Adds Russian tooltip text. |
resources/i18n/th.json |
Adds Thai tooltip text. |
resources/i18n/tr.json |
Adds Turkish tooltip text. |
resources/i18n/vi.json |
Adds Vietnamese tooltip text. |
resources/i18n/zh-CN.json |
Adds Simplified Chinese tooltip text. |
resources/i18n/zh-TW.json |
Adds Traditional Chinese tooltip text. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #7423 (FR-2899)
Summary
Sister fix to FR-2586 (#7409): when the user has switched keypairs after a session was created, per-session manager APIs return 403 Forbidden with
"Only admins can perform operations on behalf of other users.". Today the session row's action buttons (view logs, terminate, app launcher, terminal, container commit, SFTP) still look enabled — the user only discovers the problem after clicking and gets a backend error that reads as if they don't own the session (they do — they're just acting under a different access key).This change detects the mismatch on the client (
session.access_key !== baiClient._config.accessKey) and disables those buttons up front, with a tooltip explaining the cause and the recovery path. FR-2586 already produced a friendly post-failure error for app launch; preemptive disable is preferable because the user no longer has to attempt the action first.Implementation
react/src/components/ComputeSessionNodeItems/SessionActionButtons.tsx:isAccessKeyMismatchderived fromsession.access_keyvsbaiClient._config.accessKey.resolveTooltip(defaultTitle)helper that swaps the tooltip text for the explanation message when the mismatch is in effect, otherwise returns the original title.isAccessKeyMismatchinto thedisabledprop of every per-session action button: logs, terminate, app launcher, terminal, SFTP, container commit, and the two primary-app buttons (Jupyter / File browser).Tooltiptitle and thetitleHTML attr used inisButtonTitleMode) throughresolveTooltip.isActiveis false).resources/i18n/*.json(21 locales): addedsession.AccessKeyMismatchTooltipwith native translations.Test Plan
bash scripts/verify.shpasses (no new TypeScript / lint / format / Relay errors introduced).