Skip to content

fix(email): stop flooding the log when email polling fails - #156

Open
tryingET wants to merge 1 commit into
agnt-gg:mainfrom
tryingET:fix/email-poll-noise
Open

tryingET wants to merge 1 commit into
agnt-gg:mainfrom
tryingET:fix/email-poll-noise

Conversation

@tryingET

Copy link
Copy Markdown
Contributor

Problem

EmailReceiver polls /email/poll every 10 seconds and logs the entire axios error on every failure: request, socket and agent included. On one desktop install that was 83,334 log entries in a week, which pushed the daily log to 366 MB:

  • 41,599 × HTTP 410 { error: 'retired', reason: 'pro_required', service: 'mail.agnt.gg' }
  • 41,581 × HTTP 401 { error: 'Authentication required', reason: 'missing' } (before sign-in)

Change

  • A failure logs one short line (status plus the server's reason), and only when the reason changes. A later success logs one "recovered" line.
  • 410 means the mail service will not serve this client, so polling stops until the next start instead of retrying every 10 seconds forever.
  • Behaviour on success is unchanged.

Please check

  • Is stopping on 410 right for your pro_required rollout? If a user upgrades while the app is running, email triggers resume only after a restart. An alternative is a long back-off (for example hourly) instead of stopping.

Verification

  • New EmailReceiver.poll.test.js: 3 tests (410 stops with one short line, repeated 401 logs once, reason change and recovery). All 3 failed before the change and pass after.
  • Full backend: 6,340 passed. The 2 failing files also fail on main: sessionTokenCache.test.js (date-expired fixture, fixed in fix(storage): prevent test boot of real user database #145) and browserActDriver.live.test.js (needs a real browser).

Every failed /email/poll logged the whole axios error (request, socket,
agent) every 10 seconds. On one install that was 83k entries in a week:
41k 'HTTP 410 retired, pro_required' and 41k 'HTTP 401' before sign-in.

- Failures log one short line (status plus the server's reason), and
  only when the reason changes; a later success logs one recovery line.
- 410 means the mail service will not serve this client, so polling
  stops until the next start instead of retrying forever.
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.

1 participant