Skip to content

fix(FR-3022): use toLocalId instead of convertToUUID on new VFolder result.id#7681

Merged
graphite-app[bot] merged 1 commit into
mainfrom
06-02-fix_fr-3022_use_tolocalid_instead_of_converttouuid_on_new_vfolder_result.id
Jun 2, 2026
Merged

fix(FR-3022): use toLocalId instead of convertToUUID on new VFolder result.id#7681
graphite-app[bot] merged 1 commit into
mainfrom
06-02-fix_fr-3022_use_tolocalid_instead_of_converttouuid_on_new_vfolder_result.id

Conversation

@nowgnuesLee

@nowgnuesLee nowgnuesLee commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Resolves #7680 (FR-3022)

Summary

When an admin creates a new VFolder inline via the + button in AdminModelCardSettingModal (which opens FolderCreateModalV2), the onRequestClose callback receives a result whose result.id is a Relay Globally Unique ID (base64-encoded VFolder:uuid).

The previous code passed it through convertToUUID, which only normalizes a 32-char hex sequence into dash-separated UUID format — it does not decode base64. On a base64 GlobalID it fails the regex and returns the GlobalID untouched, which then gets re-wrapped by toGlobalId, producing a doubly-encoded value the backend rejects.

This swaps convertToUUID for toLocalId (atob(globalId).split(':')?.[1]), which correctly decodes the GlobalID — matching the convention already used elsewhere in the same file (toLocalId(modelCard.id), toLocalId(values.vfolderId)).

Changes

  • react/src/components/AdminModelCardSettingModal.tsx: convertToUUID(result.id)toLocalId(result.id); dropped the now-unused convertToUUID import.

Impact

Only affects the admin inline-create-VFolder path (open Model Card Setting modal → create new VFolder via + → submit). The dropdown-select path was unaffected. Discovered while healing e2e/admin-model-card/ tests for FR-2995; once this lands, the createNewFolderViaPlus POM workaround in #7679 can be removed.

Verification

scripts/verify.sh — Relay, Lint, Format, TypeScript all PASS. (The "Vite warmup paths" check fails identically on a clean main checkout — a pre-existing environmental issue unrelated to this change.)

Copy link
Copy Markdown
Contributor Author

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 changes, fast-track this PR to the front of 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.

@github-actions github-actions Bot added the size:XS ~10 LoC label Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.65% 1808 / 27166
🔵 Statements 5.43% 2004 / 36906
🔵 Functions 5.43% 300 / 5521
🔵 Branches 3.78% 1306 / 34461
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/components/AdminModelCardSettingModal.tsx 0% 0% 0% 0% 70-208
Generated in workflow #1336 for commit 83cec79 by the Vitest Coverage Report Action

@nowgnuesLee nowgnuesLee marked this pull request as ready for review June 2, 2026 07:30
Copilot AI review requested due to automatic review settings June 2, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the admin “inline create VFolder via + button” flow in AdminModelCardSettingModal by correctly decoding Relay GlobalIDs before re-encoding them for the BAIVFolderSelect form field, avoiding a doubly-encoded folder ID that the backend rejects.

Changes:

  • Replace convertToUUID(result.id) with toLocalId(result.id) when handling FolderCreateModalV2.onRequestClose.
  • Remove the now-unused convertToUUID import.

@nowgnuesLee nowgnuesLee requested a review from agatha197 June 2, 2026 07:41

@agatha197 agatha197 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@graphite-app

graphite-app Bot commented Jun 2, 2026

Copy link
Copy Markdown

Merge activity

…esult.id (#7681)

Resolves #7680 (FR-3022)

## Summary

When an admin creates a new VFolder inline via the `+` button in `AdminModelCardSettingModal` (which opens `FolderCreateModalV2`), the `onRequestClose` callback receives a `result` whose `result.id` is a Relay **Globally Unique ID** (base64-encoded `VFolder:uuid`).

The previous code passed it through `convertToUUID`, which only normalizes a 32-char hex sequence into dash-separated UUID format — it does **not** decode base64. On a base64 GlobalID it fails the regex and returns the GlobalID untouched, which then gets re-wrapped by `toGlobalId`, producing a doubly-encoded value the backend rejects.

This swaps `convertToUUID` for `toLocalId` (`atob(globalId).split(':')?.[1]`), which correctly decodes the GlobalID — matching the convention already used elsewhere in the same file (`toLocalId(modelCard.id)`, `toLocalId(values.vfolderId)`).

## Changes

- `react/src/components/AdminModelCardSettingModal.tsx`: `convertToUUID(result.id)` → `toLocalId(result.id)`; dropped the now-unused `convertToUUID` import.

## Impact

Only affects the admin inline-create-VFolder path (open Model Card Setting modal → create new VFolder via `+` → submit). The dropdown-select path was unaffected. Discovered while healing `e2e/admin-model-card/` tests for FR-2995; once this lands, the `createNewFolderViaPlus` POM workaround in #7679 can be removed.

## Verification

`scripts/verify.sh` — Relay, Lint, Format, TypeScript all PASS. (The "Vite warmup paths" check fails identically on a clean `main` checkout — a pre-existing environmental issue unrelated to this change.)
@graphite-app graphite-app Bot force-pushed the 06-02-fix_fr-3022_use_tolocalid_instead_of_converttouuid_on_new_vfolder_result.id branch from 5fe54a0 to 83cec79 Compare June 2, 2026 09:11
@graphite-app graphite-app Bot merged commit 83cec79 into main Jun 2, 2026
13 checks passed
@graphite-app graphite-app Bot deleted the 06-02-fix_fr-3022_use_tolocalid_instead_of_converttouuid_on_new_vfolder_result.id branch June 2, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS ~10 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AdminModelCardSettingModal: use toLocalId instead of convertToUUID on new VFolder result.id

3 participants