Skip to content

[BUG] Trezu - Settings: Timezone list fails silently when API request fails/blocked #1216

Description

@rknearn-qa

Summary

When the Timezones API request fails, the Preferences page incorrectly treats the failure as a successful response with an empty timezone list.

The timezone dropdown appears empty without any error message, even though the application already has a dedicated error toast for failed timezone loading.

Preconditions

Steps To Reproduce

  1. Open Settings → Preferences.

  2. Open DevTools → Network.

  3. Block the timezone API request:

    *timezones*
    

    or:

    /api/proxy/timezones
    
  4. Hard refresh the Preferences page or reopen the tab.

  5. Open the Timezone dropdown.

Actual Result

  • Timezone list is empty / shows no available timezones.
  • No error toast or other indication that loading failed is displayed.
  • The API failure is silently treated as an empty result.
Timezone.webm
Image

Expected Result

  • The timezone loading failure should be clearly communicated to the user.

  • A dedicated error toast should be displayed when the timezone API request fails.

  • The UI should distinguish between:

    • Successfully loaded empty data.
    • Failed timezone request.

Special Notes

Possible Root Cause:

getTimezones() appears to swallow the API error and return [].

This causes the Preferences UI to interpret:

API request failed
        ↓
getTimezones() returns []
        ↓
Timezone dropdown receives empty list
        ↓
UI shows "no timezones"
        ↓
No error state / toast is triggered

The code already contains an appropriate "failed to load timezones"
toast message, but the swallowed API error prevents that error path
from being reached.

The API failure should be propagated to the caller so the existing
error notification can be displayed.

Workarounds

  • Unblock the timezone API request and reload Preferences.

Repro Rate

Always (10/10)

Setup - OS - Browser - Environment

  • OS / Devices: Windows 11 (x64)
  • Screen resolution(s): 1366 x 768, 1600 x 720, 1792×828
  • Browser(s) + version(s): Chrome (150.0.7871.129), Mozilla Firefox (151.0.3), Brave (1.91.168), Edge (149.0.4022.52)
  • Wallet: Meteor
  • App environment: Staging (trezu.app)
  • Near Network: Mainnet

Resources & Additional Notes

Impact

User Impact

  • Users may believe that no timezones are available.
  • Users cannot select or change their timezone.
  • The absence of an error message makes the problem difficult to diagnose.

System Impact

  • API failure is incorrectly represented as valid empty data.
  • Error handling implemented in the UI is bypassed.

Business / Release Risk

  • Low-to-medium UX and configuration reliability issue.
  • Can silently prevent users from configuring their preferred timezone.

QA Verdict

Verdict: ❌ Needs Fix

Rationale

A failed API request should not be indistinguishable from a valid empty response. Since the application already has an error toast for this scenario, the underlying API error should be propagated so the user receives clear feedback.

Recommendation

  • Do not return [] from getTimezones() when the API request fails.

  • Propagate the error to the Preferences/query layer.

  • Trigger the existing timezone loading failed toast.

  • Preserve previously loaded timezone data during background refetch failures where possible.

  • Add regression coverage for:

    • Blocked /api/proxy/timezones.
    • Network timeout.
    • 5xx response.
    • Successful recovery after API becomes available.
    • Genuine empty timezone response, if supported.

Priority

🟡 P2 : Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions