Skip to content

[1962] Unify frontend API root normalization - #2744

Merged
Chris0Jeky merged 1 commit into
mainfrom
issue-1962/api-root
Sep 6, 2026
Merged

[1962] Unify frontend API root normalization#2744
Chris0Jeky merged 1 commit into
mainfrom
issue-1962/api-root

Conversation

@Chris0Jeky

Copy link
Copy Markdown
Owner

Summary

  • extract the terminal-/api normalization shared by version and realtime paths
  • preserve the existing versionApi export/test contract while using the shared utility
  • keep /health/live and /hubs/boards suffixes at their existing server-root paths

Proof

  • red-first api-root suite failed before the utility existed with the expected unresolved import
  • API-root, versionApi, and useBoardRealtime suites: 46 passed
  • table coverage includes empty/root-relative/absolute/deployment-subpath/trailing-slash/terminal-/api and substring cases
  • npm run lint (8 pre-existing warnings, 0 errors)
  • npm run typecheck
  • npm run build (known ineffective dynamic-import warning only)
  • git diff --check

Refs #1962

No issue close or merge requested; this PR is intentionally left open for review.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Fresh-context review record (coordinator, 2026-09-06; read-only Opus 5 reviewer over the diff against the merge base; route: the standing D-12 rule for Codex-session PRs — review, fix MEDIUM+ in-PR, merge, disposition comment).

VERDICT: SHIP, nothing fixed in-PR. The regex moved byte-identical to utils/apiRoot.ts; versionApi re-exports it so its test contract holds; callers unchanged in behaviour.

LOWs recorded for #1962: the move drops versionApi's rationale for taking the base as a parameter (build-time inlined env, testability); only normalization is unified while the VITE_API_BASE_URL || 'http://localhost:5000/api' default is still duplicated in five files (worth its own issue); resolveHubUrl is exported solely for the spec, and the ['/', '/'] row codifies the pre-existing protocol-relative //hubs/boards shape.

@Chris0Jeky
Chris0Jeky merged commit 2a8c45a into main Sep 6, 2026
35 checks passed
@Chris0Jeky
Chris0Jeky deleted the issue-1962/api-root branch September 6, 2026 11:53
@github-project-automation github-project-automation Bot moved this from Pending to Done in Taskdeck Execution Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant