desktop reads everything by itself: one background read scheduler (4 per store, starts spaced per account, App Store Connect X-Rate-Limit slows it below 20 % and pauses at 100 left, backoff with jitter on 429 / RESOURCE_EXHAUSTED, visible app first, one read per key), per-method TTLs over the saved reads, Settings auto-read (on) and interval (15 min, paused while hidden), Refresh all, a refresh icon and 'read 3 min ago' / 'couldn't refresh' per card, writes invalidate, status line with progress and quota; quota reaches the window through ToolResult.quota (cli/lib/quota.ts); Health top issues open with versions, sample stack (health --issue / --signature, read health_issue), Open in Play Console, Copy for AI and likely-cause hints (cli/lib/crash-hints.ts); tests/scheduler.test.ts, tests/quota-crash-hints.test.ts, boot check auto-read case

This commit is contained in:
CRTkafa 2026-10-13 23:36:30 +08:00
parent 89256f1e80
commit 0fb4ce0001
46 changed files with 1531 additions and 141 deletions

22
cli/lib/crash-hints.ts Normal file
View file

@ -0,0 +1,22 @@
// "Likely cause" hints for known crash signatures, shared by `storebound health` and the desktop Health tab.
// Only entries verified in a real app (or documented by the library itself) go here: a wrong hint costs more than none.
export interface CrashHint { id: string; cause: string; fix: string }
interface Rule extends CrashHint { match: (text: string) => boolean }
const RULES: Rule[] = [
{
id: 'capacitor-permission-states-npe',
match: x => /NullPointerException/.test(x) && /com\.getcapacitor\.Bridge\.getPermissionStates/.test(x),
cause: 'A Capacitor plugin\'s checkPermissions() (for example FirebaseMessaging) ran during an activity transition (focus / visibilitychange while the app resumes or rotates), when the bridge has no activity.',
fix: 'Ask for the permission state only when App.getState() says active, the page is visible and the app has been active for a short delay (e.g. 500 ms); do not call checkPermissions() from focus / visibilitychange handlers directly.',
},
];
/** The hint for an issue's text (cause, location, top frames), or null. */
export function crashHint(...texts: (string | undefined | null)[]): CrashHint | null {
const text = texts.filter(Boolean).join('\n');
const r = RULES.find(x => x.match(text));
return r ? { id: r.id, cause: r.cause, fix: r.fix } : null;
}