Skip to content

Fix refresh interval bug, batch API calls, add resilience - #3

Merged
agb1986 merged 2 commits into
mainfrom
291225_improvments
Aug 8, 2026
Merged

agb1986 merged 2 commits into
mainfrom
291225_improvments

Conversation

@agb1986

@agb1986 agb1986 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixed robotgo.Sleep(840) sleeping in seconds not ms — the ticker was actually refreshing every 14 minutes instead of the intended 840ms; interval is now explicit, correct, and configurable via -interval
  • Kept the loop and the intentional "phantom keystroke" (keeps the work machine's session active) exactly as designed — the key is now configurable via keepalive_key in config (default f15 instead of f10, since F10 opens menus in whatever app has focus)
  • Batched the CoinMarketCap request across all symbols instead of one HTTP call per symbol
  • Cached Finnhub ISIN→symbol lookups instead of re-resolving them every refresh cycle
  • Added per-symbol failure resilience: a bad quote now renders as a warning row instead of aborting the whole table
  • Guarded nil Finnhub quote fields to prevent panics on off-hours/unknown symbols
  • Replaced viper with plain yaml.v3, dropped the jsonpath round-trip and unused finnhub-go v1 dependency
  • Added -once, -json, -interval, -config, -no-clear CLI flags and NO_COLOR support
  • Added CI workflow (go vet, gofmt, build, test) and unit tests for the crypto/stock/table/config code paths

Test plan

  • make lint (go vet + gofmt + build) passes
  • make test passes (all packages, no live API keys required)
  • make build produces a working binary; -h flag output verified
  • Manual smoke test against real FINNHUB_API_KEY/CMC_API_KEY in the target environment

🤖 Generated with Claude Code

agb1986 and others added 2 commits August 8, 2026 12:01
robotgo.Sleep(840) sleeps in seconds not ms, so the ticker was actually
refreshing every 14 minutes instead of 840ms. Made the interval explicit
and configurable instead of silently wrong. The keepalive keystroke and
loop stay as-is by design, now with a configurable key (default f15,
since F10 pops menus in focused apps).

Also: batch the CoinMarketCap request across symbols instead of one per
symbol, cache Finnhub ISIN->symbol lookups instead of re-resolving every
cycle, render partial failures as a warning row instead of aborting the
whole table, guard nil quote fields to avoid panics, replace viper with
plain yaml.v3, add -once/-json/-interval/-config/-no-clear flags, and
add CI plus tests for the new code paths.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
f15 has no bound keycode on a stock X11/XKB layout, so robotgo
synthesizes keycode 0 for KeyTap. X11's XTEST extension rejects that
with a fatal BadValue error that kills the process outright (not a
catchable Go error) -- confirmed live: the ticker died right after its
first successful refresh. f10 is reliably mapped everywhere, which is
why the original hardcoded value never hit this.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@agb1986
agb1986 merged commit 19014d3 into main Aug 8, 2026
1 check passed
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