jlcodes99/cockpit-tools · warning

[TraeAutoCheckin] 刷新账号列表失败:

Error message

[TraeAutoCheckin] 刷新账号列表失败:

What it means

After a cycle that performed at least one checkin, the service refreshes the account list via the zustand store's fetchAccounts so credits/status shown in the UI are current. The promise rejection is caught and only warned, because a failed refresh does not invalidate the checkins themselves.

Source

Thrown at src/services/traeAutoCheckinService.ts:395

          ? 'partial'
          : 'failed';

    addTraeAutoCheckinLog({
      id: `log_${startTime}_${Math.random().toString(36).substring(2, 7)}`,
      timestamp: startTimestampStr,
      date: todayStr,
      durationMs,
      totalAccounts: targetAccounts.length,
      successCount,
      alreadyCheckedCount,
      failedCount,
      status: overallStatus,
      details,
    });

    if (didCheckinAny) {
      void useTraeAccountStore.getState().fetchAccounts().catch((err) => {
        console.warn('[TraeAutoCheckin] 刷新账号列表失败:', err);
      });
    }
    return retryNeeded ? 'retry' : 'completed';
  } catch (err) {
    console.error('[TraeAutoCheckin] 自动签到周期失败:', err);
    return 'retry';
  } finally {
    isAutoCheckinCycleRunning = false;
  }
}

View on GitHub (pinned to 1ed8b77992)

Solutions

  1. Confirm auth/session is still valid and retry fetchAccounts
  2. Check the accounts-list endpoint/network — the checkin succeeded so connectivity was partial
  3. Ignore if transient: next cycle or manual refresh will update the list

Example fix

// before
void useTraeAccountStore.getState().fetchAccounts().catch((err) => {
  console.warn('[TraeAutoCheckin] 刷新账号列表失败:', err);
});
// after
void useTraeAccountStore.getState().fetchAccounts()
  .catch((err) => { console.warn('[TraeAutoCheckin] 刷新账号列表失败:', err); })
  .finally(() => setTimeout(() => void useTraeAccountStore.getState().fetchAccounts(), 5000));
Defensive patterns

Strategy: retry

Validate before calling

if (typeof navigator !== 'undefined' && !navigator.onLine) {
  console.warn('skip accounts refresh while offline');
} else {
  void useTraeAccountStore.getState().fetchAccounts();
}

Try / catch

useTraeAccountStore.getState().fetchAccounts()
  .catch((err) => console.warn('[TraeAutoCheckin] 刷新账号列表失败:', err))
  .finally(() => scheduleRefreshRetry());

Prevention

When it happens

Trigger: useTraeAccountStore.getState().fetchAccounts() rejects — its own accounts-list request fails (network error, auth expiry, Rust invoke failure) right after checkins succeeded.

Common situations: Provider rate-limits the second request; token expired between the checkin call and the list call; offline transition mid-cycle.

Related errors


AI-assisted analysis of jlcodes99/cockpit-tools@1ed8b77992 (2026-09-05). Data as JSON: /api/errors/2f71c29abd9726dc. Report an issue: GitHub.