Skip to content

feat(api): sync Client with Server API contract#48

Merged
hwangjokim merged 3 commits into
mainfrom
feat/47-server-api-sync
May 15, 2026
Merged

feat(api): sync Client with Server API contract#48
hwangjokim merged 3 commits into
mainfrom
feat/47-server-api-sync

Conversation

@hwangjokim
Copy link
Copy Markdown
Member

Summary

  • mirror the latest Server account deletion flow with deletion email send, code validation, and bodyless user deletion
  • add the current project group API contract, request wrapper, query hook, real-mode team-space rendering, and MSW handler
  • update Client OpenAPI to match the latest Server controller surface

Validation

  • pnpm typecheck
  • pnpm biome lint .
  • pnpm build (passes; Vite warns that Node 20.15.0 is below the recommended 20.19+)

Closes #47

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
client Ready Ready Preview, Comment May 15, 2026 2:30pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fb5a1e578

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/>
) : null}

{isSignedIn && projectGroupQuery.error ? (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Suppress 'no team' notice when cached data is present

This error branch runs whenever projectGroupQuery.error is set, even if projectGroupQuery.data still exists from a previous successful fetch. In TanStack Query, background refetch failures can leave stale data in cache, so this renders a contradictory UI (활성 팀 스페이스가 없습니다 plus a populated team panel) and misleads signed-in users during transient API errors. Gate this notice on !projectGroupQuery.data (or initial error state) to avoid false negatives.

Useful? React with 👍 / 👎.

Comment thread src/lib/api/mocks/handlers.ts Outdated
);
}

if (!isDeleteEmailVerified) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope deletion verification to the active user session

Account deletion is authorized by a single process-wide boolean (isDeleteEmailVerified), and this check does not verify which user completed the email-code validation. If one account validates the code and then currentUser changes (e.g., OAuth login/signup handler sets a different user), the next user can delete without re-validating. Track verification per user (or reset it whenever currentUser/currentUserId changes) to prevent cross-user state leakage in the mock API.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 838aef0a81

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/>
) : null}

{projectGroupQuery.data ? (
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Guard real team panel behind authenticated state

This branch renders the full team-space payload whenever projectGroupQuery.data exists, even when isSignedIn is false. Because useMyProjectGroupQuery is only disabled (not cleared) for signed-out users, cached data from a prior authenticated session can still be returned and shown, exposing previous user team metadata after logout (or during account switching in the same tab). Gate this render path with isSignedIn (or ensure the query is cleared on auth changes) to prevent cross-session data leakage.

Useful? React with 👍 / 👎.


export const projectGroupQueryKeys = {
all: ["project-groups"] as const,
me: ["project-groups", "me"] as const,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope my-project-group query key to active auth context

The me query key is static even though /project-groups/me is user-scoped, so cache entries are reused across different authenticated users in the same client. In account-switch flows, this can surface the previous user's project-group data until a refetch completes (and persists when the query is disabled), which creates stale/cross-user UI state. Include a user/session discriminator in the key or clear this key whenever auth identity changes.

Useful? React with 👍 / 👎.

@hwangjokim hwangjokim merged commit ee461cd into main May 15, 2026
3 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a528241191

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

let activeMatchId: number | null = null;
let activeMatchMembers: MatchMemberResponse["members"] = [];
let activeMatchProject: MatchProjectResponse | null = null;
let activeProjectGroup: MyProjectGroup | null = createMockProjectGroup();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Rebuild mock project-group state after auth user changes

activeProjectGroup is initialized once from the startup currentUser/currentUserId and never refreshed when those auth values change (for example in the OAuth login and signup handlers). As a result, GET /project-groups/me can return a project group whose currentUserId and member profile data belong to a previous user, so the Team Space view shows cross-user stale data in mock mode during account-switch flows. Recompute activeProjectGroup whenever currentUser or currentUserId is reassigned (or derive it on demand in the GET handler).

Useful? React with 👍 / 👎.

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.

Sync Client with latest Server API

1 participant