Found while planning #217.
Bug
All three launchers' update blocks do:
cfg := buildUpdaterConfig()
cfg.CacheTTL = 0 // force fresh check
But Check() opens with (internal/core/updater/updater.go:63-65):
if cfg.CacheTTL == 0 { cfg.CacheTTL = 24 * time.Hour }
And buildUpdaterConfig already sets CacheTTL: 24 * time.Hour. So the line is a total no-op, not a partial one: update reads a <24h-old cache and can silently report a stale version. The explicit, user-invoked "check for updates" command does not necessarily check.
Fix sketch
CacheTTL == 0 is overloaded: it means both "unset, use the default" and "bypass the cache". Disambiguate — e.g. a negative TTL, an explicit ForceRefresh bool on Config, or a CheckFresh(ctx, cfg) entry point. Whichever way, update must actually hit the network.
Note this is a real behavior change (every update invocation gains a network call), which is why it was kept out of #217.
Also in scope — two README lines this falsifies
- README describes
update as force-checking. It does not.
- README:1056: "Both suppress the startup check and disable the update subcommand." Only the
DATABRICKS_NO_UPDATE_CHECK env var does. --no-update-check does not disable the update subcommand — the update block early-exits before parseArgs ever sees the flag.
Context
After #217 the runner is shared, so this is a one-line fix in one place. The TODO in internal/core/updater.RunUpdateCommand references this issue.
Found while planning #217.
Bug
All three launchers'
updateblocks do:But
Check()opens with (internal/core/updater/updater.go:63-65):And
buildUpdaterConfigalready setsCacheTTL: 24 * time.Hour. So the line is a total no-op, not a partial one:updatereads a <24h-old cache and can silently report a stale version. The explicit, user-invoked "check for updates" command does not necessarily check.Fix sketch
CacheTTL == 0is overloaded: it means both "unset, use the default" and "bypass the cache". Disambiguate — e.g. a negative TTL, an explicitForceRefresh boolonConfig, or aCheckFresh(ctx, cfg)entry point. Whichever way,updatemust actually hit the network.Note this is a real behavior change (every
updateinvocation gains a network call), which is why it was kept out of #217.Also in scope — two README lines this falsifies
updateas force-checking. It does not.DATABRICKS_NO_UPDATE_CHECKenv var does.--no-update-checkdoes not disable theupdatesubcommand — the update block early-exits beforeparseArgsever sees the flag.Context
After #217 the runner is shared, so this is a one-line fix in one place. The
TODOininternal/core/updater.RunUpdateCommandreferences this issue.