FPI 랭킹 내 행성·내 국가 판정 · 콜드 스타트 약관 깜빡임 · 로그아웃 상한

This commit is contained in:
Sn-Kinos
2026-10-06 04:01:15 +09:00
parent abe5f1ae50
commit 1539ae283e
9 changed files with 205 additions and 45 deletions
+26 -16
View File
@@ -216,22 +216,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
MyLinkRow(
label: l10n.settingsLogout,
color: MyColors.danger,
onTap: () => _confirm(
title: l10n.settingsLogoutConfirm,
action: l10n.settingsLogout,
// 푸시 정리를 **먼저** 한다. 보안 규칙이 `users/{uid}` 쓰기를
// `isSelf(uid)` 로 막아, 로그아웃 뒤에는 이 기기 토큰을 지울 수 없다.
// 정리가 실패해도(토픽 해제 · 토큰 쓰기 네트워크 오류) 로그아웃은 한다 — 예외가
// 그대로 올라가면 signOut 이 돌지 않아 첫 탭이 무시된 것처럼 보인다(10/6 실기기 1회).
onConfirm: () async {
try {
await widget.push?.clearOnSignOut();
} on Object catch (error) {
debugPrint('[Settings] push cleanup failed: ${error.runtimeType}');
}
await widget.auth?.signOut();
},
),
onTap: _logout,
),
const MyDivider(),
MyLinkRow(
@@ -384,6 +369,31 @@ class _SettingsScreenState extends State<SettingsScreen> {
Future<void> _notice(String message) => showAlertDialog(context, message);
/// 확인 팝업(취소 · 실행) — 시안 `554:24669` · `374:14364` · `554:23257`.
/// 푸시 정리를 **먼저** 한다. 보안 규칙이 `users/{uid}` 쓰기를 `isSelf(uid)` 로 막아,
/// 로그아웃 뒤에는 이 기기 토큰을 지울 수 없다. 정리는 확인 버튼이 진행 중으로 바뀐
/// 채 돌고, 실패하든 [_cleanupTimeout] 안에 끝나지 않든 로그아웃은 한다 — 토픽 해제 ·
/// 토큰 쓰기가 응답 없이 멈추면 signOut 에 닿지 못해 첫 확인이 무시된 것처럼
/// 보였다(10/6 실기기 2회).
Future<void> _logout() async {
final l10n = context.l10n;
final ok = await showConfirmDialog(
context,
l10n.settingsLogoutConfirm,
confirmLabel: l10n.settingsLogout,
onConfirm: () async {
try {
await widget.push?.clearOnSignOut().timeout(_cleanupTimeout);
} on Object catch (error) {
debugPrint('[Settings] push cleanup skipped: ${error.runtimeType}');
}
},
);
if (ok) await widget.auth?.signOut();
}
/// 로그아웃 전 정리의 상한. 넘기면 정리를 두고 로그아웃한다.
static const _cleanupTimeout = Duration(seconds: 3);
Future<bool> _confirm({
required String title,
String? body,