Skip to content

fix(client): Handle empty groups and API paths#180

Merged
IsaacCheng9 merged 3 commits into
mainfrom
fix/client-empty-state-api-contract
Jun 5, 2026
Merged

fix(client): Handle empty groups and API paths#180
IsaacCheng9 merged 3 commits into
mainfrom
fix/client-empty-state-api-contract

Conversation

@IsaacCheng9

@IsaacCheng9 IsaacCheng9 commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added an empty-group client path
    • Kept the initial screen usable when /users returned no records
    • Made the first created user become the active user
  • Centralised client API routing
    • Replaced hardcoded client-side localhost calls with relative API paths
    • Kept REACT_APP_API_URL available for non-proxy deployments
  • Expanded frontend regression coverage
    • Covered empty database loading and first-user creation with mocked API calls
    • Fixed the case-sensitive component import that would fail on Linux
  • Added client verification to CI
    • Ran the client test suite and production build alongside the existing backend job
    • Synchronised client/package-lock.json so npm 10 can use npm ci
  • Stabilised the backend duplicate-user test
    • Waited for Mongoose user indexes before asserting duplicate-key rejection

Rationale

  • The app previously assumed a populated user collection
    • A fresh database followed the README setup path into users[0].username, crashing before anyone could create the first user
  • Relative API paths match the existing CRA proxy setup
    • This removed the localhost:3000 / localhost:3001 split without committing the project to one deployment host
  • Mongoose unique constraints are index-backed
    • The duplicate-user regression test could run before the in-memory Mongo indexes were ready, making CI nondeterministic

@IsaacCheng9 IsaacCheng9 merged commit 763a81a into main Jun 5, 2026
3 checks passed
@IsaacCheng9 IsaacCheng9 deleted the fix/client-empty-state-api-contract branch June 5, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant