Skip to content

[Bug]: Accidentally setting invalid time zone breaks dashboard #51

Closed

Description

@ekimminau

Preflight checklist

  • I searched existing issues and didn't find a duplicate.
  • I'm on the latest version of the extension, or I've written my version below.
  • I read the README's Troubleshooting section (proxies, history retention, the AI advice feature).

What happened?

I was looking through settings and set my timezone to "est-5 Detroit" there was no validation check. Now on trying to load the dashboard and in the visal code bottom bar it reports a red "Error" and in the tab: Error
Invalid time zone specified: EST-5 Detroit. How do I correct this?

What did you expect instead?

Dashboard settings should validate timezone, have a pulldown of valid values and never allow exit for a broken value.

Steps to reproduce

  1. Open the Dashboard
  2. Go to Settings
  3. Change the timezone to an invalid value
  4. navigate back to dashboard

Extension version

2.1.0

Claude Code version

2.1.170 (Claude Code)

VS Code version

Version: 1.126.0 (user setup) Commit: 7e7950df89d055b5a378379db9ee14290772148a Date: 2026-06-23T01:46:13Z Electron: 42.2.0 ElectronBuildId: 14159160 Chromium: 148.0.7778.97 Node.js: 24.15.0 V8: 14.8.178.14-electron.0 OS: Windows_NT x64 10.0.26200

Operating system

Windows

Model / proxy setup

No response

Diagnostic logs

Here is Diagnostic log since the change: 
[11:39:03] fetch: 200 https://api.anthropic.com/api/oauth/usage
[11:39:03] usage: ok — 5h=68%, wk=31%
[11:39:30] loader: 109 files, 29713 lines | kept=6159, user-prompts=620, dedup-replaced=431, dedup-skipped=7630, parse-errors=0 | rejected: message-missing=2885, timestamp-missing-or-non-string=4469, usage-missing=7519
[11:39:30] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2872/692.8M, <synthetic>=6/0
[11:39:41] loader: 109 files, 29714 lines | kept=6159, user-prompts=620, dedup-replaced=431, dedup-skipped=7630, parse-errors=0 | rejected: message-missing=2886, timestamp-missing-or-non-string=4469, usage-missing=7519
[11:39:41] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2872/692.8M, <synthetic>=6/0
[11:39:46] loader: 109 files, 29716 lines | kept=6160, user-prompts=620, dedup-replaced=431, dedup-skipped=7631, parse-errors=0 | rejected: message-missing=2886, timestamp-missing-or-non-string=4469, usage-missing=7519
[11:39:46] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2873/692.9M, <synthetic>=6/0
[11:40:07] fetch: 200 https://api.anthropic.com/api/oauth/usage
[11:40:07] usage: ok — 5h=69%, wk=31%
[11:42:47] fetch: 200 https://api.anthropic.com/api/oauth/usage
[11:42:47] usage: ok — 5h=69%, wk=31%
[11:44:41] loader: 109 files, 29719 lines | kept=6160, user-prompts=620, dedup-replaced=431, dedup-skipped=7631, parse-errors=0 | rejected: message-missing=2888, timestamp-missing-or-non-string=4469, usage-missing=7520
[11:44:41] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2873/692.9M, <synthetic>=6/0
[11:44:47] loader: 109 files, 29720 lines | kept=6161, user-prompts=620, dedup-replaced=431, dedup-skipped=7631, parse-errors=0 | rejected: message-missing=2888, timestamp-missing-or-non-string=4469, usage-missing=7520
[11:44:47] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2874/693.0M, <synthetic>=6/0
11:46:49] loader: 109 files, 29726 lines | kept=6162, user-prompts=620, dedup-replaced=431, dedup-skipped=7633, parse-errors=0 | rejected: message-missing=2889, timestamp-missing-or-non-string=4469, usage-missing=7522
[11:46:49] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2875/693.2M, <synthetic>=6/0
[11:46:57] loader: 109 files, 29728 lines | kept=6163, user-prompts=620, dedup-replaced=431, dedup-skipped=7634, parse-errors=0 | rejected: message-missing=2889, timestamp-missing-or-non-string=4469, usage-missing=7522
[11:46:57] loader: models seen: claude-haiku-4-5-20251001=3281/330.5M, claude-sonnet-4-6=2876/693.3M, <synthetic>=6/0

Anything else?

No response

Activity

  1. Carl723000 commented on Jul 1, 2026

    @Carl723000
    Collaborator

    Thanks @ekimminau — good catch, and you're right that it should never have been accepted. Fix is up in #52: the timezone setting is now validated and an invalid value falls back to your system zone instead of throwing, so the dashboard can't be bricked this way (and it'll auto-recover your current config on next load). To unstick it right now, set the Timezone setting back to empty (⚙ Settings → General) — empty = system zone. A proper validated dropdown of zones is a sensible follow-up.

  2. ekimminau commented on Jul 1, 2026

    @ekimminau
    Author

    I wrote a script to modify the vscode db to correct the time zone:
    `C:\tmp> cat .\fix-claude-usage-timezone.ps1
    <#
    Fixes a corrupted timezone value ("EST-5 Detroit") stored by the "Claude Code Usage"
    VS Code extension inside VS Code's global state database (state.vscdb).

    This value is not a valid IANA timezone identifier, which is why the extension keeps
    reporting a "time zone configuration issue" even after uninstall/reinstall - the bad
    value lives in VS Code's globalState (state.vscdb), not in the extension's own files,
    so it survives extension removal.

    MUST be run with VS Code fully closed (the sqlite db is locked while VS Code is running).
    Run this in an elevated (Administrator) PowerShell window.
    #>

    $ErrorActionPreference = "Stop"

    $stateDbPath = "$env:APPDATA\Code\User\globalStorage\state.vscdb"
    $key = "GrowthJack.claude-code-usage"
    $badValue = "EST-5 Detroit"
    $goodValue = "America/Detroit"

    1. Refuse to run while VS Code is open - the db file will be locked and/or VS Code

    could overwrite our change on exit.

    $vscodeProcs = Get-Process -Name "Code" -ErrorAction SilentlyContinue
    if ($vscodeProcs) {
    Write-Host "VS Code is still running (found $($vscodeProcs.Count) Code.exe process(es)). Close it completely and re-run this script." -ForegroundColor Red
    exit 1
    }

    if (-not (Test-Path $stateDbPath)) {
    Write-Host "State database not found at: $stateDbPath" -ForegroundColor Red
    exit 1
    }

    2. Back up the database before touching it.

    $backupPath = "$stateDbPath.bak-$(Get-Date -Format 'yyyyMMdd-HHmmss')"
    Copy-Item -Path $stateDbPath -Destination $backupPath
    Write-Host "Backup created at: $backupPath" -ForegroundColor Green

    3. Patch the value using Python's built-in sqlite3 module.

    $pythonScript = @'
    import sqlite3
    import json
    import sys

    db_path, key, bad_value, good_value = sys.argv[1:5]

    con = sqlite3.connect(db_path)
    cur = con.cursor()
    cur.execute("SELECT value FROM ItemTable WHERE key = ?", (key,))
    row = cur.fetchone()
    if row is None:
    print("KEY_NOT_FOUND")
    sys.exit(1)

    raw = row[0]
    if isinstance(raw, bytes):
    raw = raw.decode("utf-8")

    data = json.loads(raw)
    current_tz = data.get("ccu.setting.timezone")
    print(f"Current value: {current_tz}")

    if current_tz != bad_value:
    print(f"WARNING: current timezone value does not match expected bad value ({bad_value!r}). No change made.")
    sys.exit(2)

    data["ccu.setting.timezone"] = good_value
    new_raw = json.dumps(data)

    cur.execute("UPDATE ItemTable SET value = ? WHERE key = ?", (new_raw, key))
    con.commit()
    con.close()
    print(f"Updated value to: {good_value}")
    '@

    $pythonScriptPath = Join-Path $env:TEMP "fix-ccu-timezone.py"
    Set-Content -Path $pythonScriptPath -Value $pythonScript -Encoding UTF8

    python $pythonScriptPath $stateDbPath $key $badValue $goodValue
    $exitCode = $LASTEXITCODE

    if ($exitCode -eq 0) {
    Write-Host "Done. Start VS Code and check the Claude Code Usage extension." -ForegroundColor Cyan
    } else {
    Write-Host "Patch did not apply cleanly (exit code $exitCode). Database was NOT modified beyond what the script reports above." -ForegroundColor Yellow
    }

    Write-Host "If anything looks wrong afterward, restore the backup with:" -ForegroundColor Yellow
    Write-Host " Copy-Item '$backupPath' '$stateDbPath' -Force" -ForegroundColor Yellow`

  3. Carl723000 commented on Jul 12, 2026

    @Carl723000
    Collaborator

    Fixed as of v2.2.0 — the Timezone setting is now a validated dropdown (Intl.supportedValuesOf) and a guard rejects any previously-persisted invalid value, so a hand-typed/bad zone can no longer make Intl throw and crash the dashboard (i18n.ts isValidTimeZone; see CHANGELOG 2.2.0, "Timezone is a validated dropdown … (#51)"). Closing as resolved — please reopen if it still reproduces on 2.2.0+.


    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions