Skip to content

Generic 'Unexpected error' shown instead of re-authentication when auth token expires during expense split #89719

@MelvinBot

Description

@MelvinBot

Bug: Generic "Unexpected error" shown instead of re-authentication when auth token expires during expense split

Slack thread: https://expensify.slack.com/archives/C049HHMV9SM/p1778034168209899

Description

When a user's auth token expires while they are actively using the app, API write commands (e.g., splitting an expense) fail with a generic "Unexpected error submitting this expense. Please try again later." message. The server returns jsonCode 407 (AuthTokenExpired), but the App does not detect this and does not trigger the ReauthenticateSession flow. The user appears fully logged in and can browse cached data, but all API writes silently fail.

Steps to Reproduce

  1. Log into NewDot web with an active session
  2. Wait for auth token to expire naturally (or let session sit idle)
  3. Open a report and select an expense
  4. Attempt to split the expense
  5. Observe the generic error message
  6. Retry — same result

Expected Behavior

The App should detect the 407 AuthTokenExpired response, automatically trigger ReauthenticateSession to refresh the token, and either retry the operation transparently or prompt the user to sign in again with the server's actual error message.

Actual Behavior

The App displays "Unexpected error submitting this expense. Please try again later." — it does not surface the real error (AuthTokenExpired) and does not trigger the auto-reauthentication flow. The user appears logged in and can browse cached data, but ALL API write commands fail with 407. In the observed case, this persisted for ~9 minutes until a full Authenticate eventually fired (no ReauthenticateSession was ever triggered).

Log Evidence

  • First attempt: request_id 9f74508e2ca27e99-BOS (01:47 UTC, 2026-05-06)
  • Second attempt: request_id 9f7455822c1c7e99-SJC (01:50 UTC, 2026-05-06)
  • Both returned jsonCode 407, AuthTokenExpired
  • During the 01:40–01:59 UTC window, virtually every API command (OpenReport, Search, PusherPing, AuthenticatePusher, Transaction_Split) was returning 407

Platform

Web (v9.3.66-7)

Possibly Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    DailyKSv2Hot PickReady for an engineer to pick up and run withInternalRequires API changes or must be handled by Expensify staff

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions