Skip to content

fix(auth): 登出不再卡在提醒运行时停机 - #388

Merged
gac0812 merged 2 commits into
1024XEngineer:mainfrom
gac0812:fix/home-sign-out-hangs
Aug 26, 2026
Merged

gac0812 merged 2 commits into
1024XEngineer:mainfrom
gac0812:fix/home-sign-out-hangs

Conversation

@gac0812

@gac0812 gac0812 commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • 首页退出登录会一直转圈:失效协调器先等 runtime.stop()(提醒引擎 / 定位 native)才清会话,真机上 stopLocationUpdates 可能不返回。
  • 改为先清会话再拆账号内存;账号清理和定位 stop 各加 2s 超时,卡住也不挡登录页。

Fixes #387

Test plan

  • 登录后点首页退出登录:应马上回到登录页,不要一直转圈
  • 有地点提醒、定位守护在跑时再登出一次,同样应回到登录页
  • 登出后可以重新登录

Verification

cd frontend
npx jest --runInBand tests/unit/features/auth/application/AuthInvalidationCoordinator.test.ts tests/unit/features/reminder/application/ReminderGuardCoordinator.test.ts

首页退出登录会一直转圈,因为失效协调器先等 runtime.stop()(定位 native 可能不返回)才清会话。改为先失效会话,账号清理和定位 stop 加超时。
@gac0812
gac0812 marked this pull request as ready for review August 26, 2026 06:45
@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.33962% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...es/auth/application/AuthInvalidationCoordinator.ts 83.33% 3 Missing ⚠️
Flag Coverage Δ
backend 96.64% <ø> (ø)
frontend 89.74% <94.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/reminder/application/ReminderGuardCoordinator.ts 100.00% <100.00%> (ø)
...es/auth/application/AuthInvalidationCoordinator.ts 90.00% <83.33%> (-4.12%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the auth invalidation and reminder shutdown changes against the PR contract. The session is now cleared before account cleanup and the timeout addresses the reported hang, but the timeout path needs to preserve the coordinator's shutdown invariant so an in-flight reconcile cannot restart native location updates after logout.

Verification: git diff --check passed. The requested Jest suites could not run because this checkout has no installed dependencies (jest-expo is unavailable).

stop() 与卡在原生查询上的 reconcile 竞态时,超时只能让登出继续,不能让那次 reconcile 在账户失效后再 startLocationUpdatesAsync。

@LUPENGHAN LUPENGHAN left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok

@gac0812
gac0812 merged commit dc44fd1 into 1024XEngineer:main Aug 26, 2026
5 checks passed
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