Skip to content

fix: preserve subscription references and session logout - #99

Merged
Ryson-32 merged 8 commits into
mainfrom
ryan/dev
Sep 24, 2026
Merged

Ryson-32 merged 8 commits into
mainfrom
ryan/dev

Conversation

@Ryson-32

Copy link
Copy Markdown
Member

Summary

  • Preserve node references and relay groups across subscription refreshes.
  • Make local session logout and revocation reliable, with coverage for failure paths.

Validation

  • Public CI and Dev Release succeeded on ryan/dev at 5ce5034.
  • Local public suite: 304 files, 1709 tests passed; all coverage measures met the 97% threshold.
  • Diff whitespace check passed.

Copilot AI lite review requested due to automatic review settings September 24, 2026 06:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T06:54:02.858503Z 5ce5034 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Ryson-32
Ryson-32 merged commit 3703669 into main Sep 24, 2026
12 checks passed

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

Copy link
Copy Markdown

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: 5ce5034945

ℹ️ 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".

console.error("Logout error:", error);
const message = error instanceof Error ? error.message : "退出登录失败";
set({ error: message });
throw error instanceof Error ? error : new Error(message);

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 Catch logout rejection in the settings page

When /api/auth/logout returns 503 or the request fails, logout() now rejects. The other production caller in local/app/dashboard/settings/page.tsx still invokes void handleLogout(), whose await logout() has no catch, so clicking its logout button produces an unhandled promise rejection with no visible feedback or navigation. Update that caller to handle the new rejecting contract, as the user-menu caller does, or keep failures contained in the store.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Moderate issues remain in logout protection, rename resolution, input validation, and logout error handling.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Preserves subscription references across refreshes and adds persistent local session revocation and logout handling.

Changes:

  • Reconciles renamed node and relay-group references.
  • Filters invalid relay references during generation and refresh.
  • Adds session revocation storage, cleanup, and failure-path coverage.
File Summary
packages/​ui/​src/​store/​user-store.ts Handles logout failures.
packages/​ui/​src/​store/​user-store.test.ts Tests logout failure behavior.
packages/​ui/​src/​store/​config-store/​source-actions.ts Reconciles subscription references.
packages/​ui/​src/​store/​config-store/​source-actions.test.ts Tests source refresh reconciliation.
packages/​ui/​src/​store/​config-store/​source-actions-relay-groups.test.ts Tests relay-group filtering.
packages/​ui/​src/​store/​config-store/​source-actions-multiple.test.ts Tests multi-source merging.
packages/​ui/​src/​product/​converter/​advanced-mode/​sections/​dialer-proxy-groups-section.tsx Filters selectable relay groups.
packages/​ui/​src/​product/​converter/​advanced-mode/​sections/​dialer-proxy-groups-section.test.ts Tests relay-group visibility.
packages/​ui/​src/​components/​auth/​user-menu.tsx Displays logout errors.
packages/​ui/​src/​components/​auth/​user-menu.test.ts Tests logout error UI.
packages/​server-core/​src/​subscription/​refresh-node-snapshot.ts Produces composed rename maps.
packages/​server-core/​src/​subscription/​refresh-node-snapshot.test.ts Tests rename-map output.
packages/​server-core/​src/​subscription/​refresh-cache-result.ts Persists reconciled refresh configuration.
packages/​server-core/​src/​subscription/​refresh-cache-result.test.ts Tests refresh persistence.
packages/​server-core/​src/​subscription/​manual-refresh-response.test.ts Updates manual-refresh fixtures.
packages/​server-core/​src/​subscription/​automatic-refresh-completion.test.ts Updates automatic-refresh fixtures.
packages/​server-core/​src/​session-revocation.ts Derives revocation identities.
packages/​server-core/​src/​session-revocation.test.ts Tests revocation identity behavior.
packages/​server-core/​src/​index.ts Exports revocation utilities.
packages/​server-core/​package.json Adds the revocation export.
packages/​core/​src/​subscription/​node-name-references.ts Reconciles node references.
packages/​core/​src/​subscription/​node-name-references.test.ts Tests reference reconciliation.
packages/​core/​src/​subscription/​dialer-relay-group-names.ts Resolves valid relay names.
packages/​core/​src/​subscription/​dialer-relay-group-names.test.ts Tests relay-name resolution.
packages/​core/​src/​generator/​index.ts Filters generated relay references.
packages/​core/​src/​generator/​index.test.ts Tests relay generation.
local/​src/​lib/​subscription-service.ts Persists refreshed configuration.
local/​src/​lib/​subscription-service.test.ts Updates refresh fixtures.
local/​src/​lib/​session.ts Implements session revocation checks.
local/​src/​lib/​session.test.ts Tests session verification and revocation.
local/​src/​lib/​auto-update-service.ts Persists auto-refresh configuration.
local/​src/​lib/​auto-update-service.test.ts Updates auto-refresh fixtures.
local/​prisma/​schema.prisma Adds revoked-session storage.
local/​prisma/​migrations/​20260920090000_revoked_sessions/​migration.sql Creates the revocation table and index.
local/​app/​api/​auth/​logout/​route.ts Revokes sessions before clearing cookies.
local/​app/​api/​auth/​local-auth-routes.test.ts Tests logout failure and cleanup paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +71 to +75
return names.map((name) => name.trim()).filter((name) => {
if (!name || seen.has(name)) return false;
seen.add(name);
return availableNames.has(name);
});
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.

2 participants