Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- **HUD**: version upgrade notice persists after install — cache now stores only npm `latest`, reads installed version live

---

## [1.8.2] - 2026-03-22
Expand Down
7 changes: 3 additions & 4 deletions src/cli/hud/components/version-badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const VERSION_CACHE_KEY = 'version-check';
const VERSION_CACHE_TTL = 24 * 60 * 60 * 1000; // 24 hours

interface VersionInfo {
current: string;
latest: string;
}

Expand Down Expand Up @@ -80,17 +79,17 @@ export default async function versionBadge(
const current = getCurrentVersion(ctx.devflowDir);
if (!current) return null;

// Check cache
// Cache only the npm registry result (expensive); current is always live
let info = readCache<VersionInfo>(VERSION_CACHE_KEY);
if (!info) {
const latest = await fetchLatestVersion();
if (latest) {
info = { current, latest };
info = { latest };
writeCache(VERSION_CACHE_KEY, info, VERSION_CACHE_TTL);
}
}

if (info && compareVersions(info.current, info.latest) < 0) {
if (info && compareVersions(current, info.latest) < 0) {
const badge = `\u2726 Devflow v${info.latest} \u00B7 update: npx devflow-kit init`;
return { text: yellow(badge), raw: badge };
}
Expand Down
Loading