Skip to content

Fix detected issues#509

Merged
askpt merged 2 commits intomainfrom
askpt/fix-issues
Mar 12, 2026
Merged

Fix detected issues#509
askpt merged 2 commits intomainfrom
askpt/fix-issues

Conversation

@askpt
Copy link
Copy Markdown
Owner

@askpt askpt commented Mar 12, 2026

  • fix(web): use useRef instead of useState for timeout map in FeatureFlagsModal
  • ci: remove redundant go build step before go test

Closes #507
Closes #508

github-actions bot and others added 2 commits March 12, 2026 13:31
…agsModal

Replace the misuse of useState (keeping only the value, never calling
the setter) with useRef, which is the idiomatic React hook for mutable
values that do not need to trigger re-renders.

Changes:
- Import useRef alongside the existing React hooks
- Replace useState()[0] pattern with useRef(new Map())
- Access map via timeoutRefs.current throughout
- Remove timeoutRefs from useEffect dependency arrays (refs are stable)
- Capture refs.current in a local variable before the cleanup effect
  returns, following the lint-safe pattern for effects that capture refs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
go test -v ./... already compiles all packages (including those with
no test files) as part of its execution, making the preceding
go build -v ./... step redundant. Removing it eliminates the
double compilation and reduces Go CI job runtime.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 12, 2026 17:29
@askpt askpt enabled auto-merge (squash) March 12, 2026 17:30
Copy link
Copy Markdown
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 addresses two previously detected issues across the frontend and CI pipeline: it makes the FeatureFlags modal’s timeout tracking idiomatic in React, and streamlines Go CI by removing a redundant compilation step.

Changes:

  • Web: Replace useState(...)[0] timeout map storage with useRef in FeatureFlagsModal and adjust effect dependencies/cleanup accordingly.
  • CI: Remove the go build -v ./... step from the Go job since go test -v ./... already compiles all packages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Garage.Web/src/components/FeatureFlagsModal.tsx Uses useRef to persist a mutable timeout map without triggering re-renders; cleans up effect deps and unmount cleanup.
.github/workflows/ci.yml Removes redundant Go build step and documents why go test is sufficient.

You can also share your feedback on Copilot code review. Take the survey.

@askpt askpt merged commit 2482dee into main Mar 12, 2026
22 checks passed
@askpt askpt deleted the askpt/fix-issues branch March 12, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants