FCT2-21225: Fix "Move selected" button visible in prod due to missing feature flag gate in v1 screen - #533
Conversation
…me in pipeline The env var was added in #524 as VITE_PRIVATE_BETA_USER_GROUP2 (missing FEATURE segment), so Vite could not resolve VITE_PRIVATE_BETA_FEATURE_USER_GROUP2 at build time. This caused the transfer-move feature gate to malfunction in production. Also adds the variable to .env.playwright for test coverage.
There was a problem hiding this comment.
These changes are useful, but I don't think they'll fix the issue described in the ticket.
-
The correct value for
VITE_PRIVATE_BETA_FEATURE_USER_GROUP2is already consumed by the pipeline, even when not specified in the env block. This can be seen in the screenshot captured by Mark. -
We use the user group to enable additional features to its members, not to limit the features they have.
-
The expected behaviour is that the feature is enabled based on both conditions being true: (1) The feature flag is set to True, and (2) the user is a member of the correct group.
In the screenshot above we can see thatVITE_FEATURE_FLAG_TRANSFER_MOVEis set to"false". This alone should disable the Move functionality for Mark, regardless of his group membership. -
For additional context - Mark is already a member of group2, so if the feature was enabled for the group, he'd be able to see the Move button.
Good shout, and you're right to question it. I dug into the codebase properly and I think the env var typo is a real bug but it's not what caused what Mark saw. Here's what I found:
The actual problem is that {transferSource === "egress" && (
<Button onClick={onMove} disabled={disableControls}>
Move selected
</Button>
)}The old screen ( if (featureFlags?.transferMove) {
items = [...items, { id: `${path}:move`, label: "Move", ... }];
}That gate just never got carried over when the v1 screen was built. So the fix should be in onMove={featureFlags?.transferMove ? () => handleTransferAction("move") : undefined}And a matching guard in {transferSource === "egress" && onMove && (
<Button onClick={onMove} disabled={disableControls}>
Move selected
</Button>
)}I'll update the PR with this fix. The env var rename is still worth doing as a cleanup since the name genuinely doesn't match Thanks for pushing back on this one. |
…re flag TransferControls rendered the Move button whenever transferSource was egress, without checking featureFlags.transferMove. The old screen (NetAppFolderContainer) had this gate but it was never carried over to the v1 screen. Now onMove is only passed when featureFlags.transferMove is true, and TransferControls only renders the button when onMove is defined. Adds unit tests for TransferControls covering all render conditions.
…ot rendered when flag disabled.
|



PR checklist
Correctness
Keeping it simple
Easy to miss (a green pipeline won't flag these)
What
Two fixes for FCT2-21225 where the "Move selected" button was incorrectly showing in production on the Transfer from Egress page.
Fix 1 - Missing feature flag gate in v1 screen (root cause)
TransferControlsin the v1 screen was rendering the Move button whenevertransferSource === "egress", without checkingfeatureFlags.transferMove. The old screen (NetAppFolderContainer) had this check but it never got carried over when the v1 screen was built.onMoveis now only passed toTransferControlswhenfeatureFlags.transferMoveis trueTransferControlsonly renders the button whenonMoveis definedFix 2 - Env var name mismatch in pipeline (secondary bug)
PR #524 added
VITE_PRIVATE_BETA_USER_GROUP2to the pipelineenv:block with theFEATUREsegment missing.config.tsreferencesVITE_PRIVATE_BETA_FEATURE_USER_GROUP2, so Vite couldn't resolve the value at build time. This means group-gated features (transferMove,caseDetails,globalNav) can't correctly resolve group membership.VITE_PRIVATE_BETA_FEATURE_USER_GROUP2in the pipeline YAML.env.playwrightfor test coverageWhy
User could see the Move button in prod because:
VITE_FEATURE_FLAG_TRANSFER_MATERIALS_V1 = "true"routes all users to the v1 screenonMoveunconditionally with no check againstfeatureFlags.transferMoveTransferControlsrendered the button whenevertransferSource === "egress"The env var typo is a separate real bug (group membership checks are broken for any feature using
PRIVATE_BETA_FEATURE_USER_GROUP2as agroupKey) but it wasn't the direct cause of what user saw.Resolves FCT2-21225