Skip to content

Add automatic update notifications on startup#2834

Merged
tastybento merged 2 commits intodevelopfrom
worktree-auto-update-notifications
Mar 8, 2026
Merged

Add automatic update notifications on startup#2834
tastybento merged 2 commits intodevelopfrom
worktree-auto-update-notifications

Conversation

@tastybento
Copy link
Member

Summary

  • Fix bug: GitHubWebAPI.fetchArray() added (extracts fetchRaw() helper); fixes getContributors() which previously called fetch(...).getAsJsonArray() but fetch() already calls getAsJsonObject() internally — this would throw on a real response
  • New: GitHubRepository.getLatestTagName() fetches the /tags endpoint and returns the first tag name
  • New: WebManager gains isNewerVersion(), checkForUpdates(), and printUpdateBanner(); wired into requestGitHubData() gated by the pre-existing isCheckBentoBoxUpdates() setting (default: true)

Behavior

  • Runs async ~1s after startup (same timing as existing GitHub data fetch)
  • Skips LOCAL builds (dev environments)
  • Silently fails on network errors — no console noise
  • Prints a colored banner to console when a newer tag is available

Test plan

  • GitHubRepositoryTest — 3 tests for getLatestTagName() (happy path, empty array, API throws)
  • WebManagerTest — 8 tests for isNewerVersion() covering minor/patch/major bumps, snapshot stripping, leading v stripping
  • ./gradlew build passes

🤖 Generated with Claude Code

tastybento and others added 2 commits March 7, 2026 19:46
- Extract fetchRaw() in GitHubWebAPI and add fetchArray() to correctly
  handle JSON array responses (fixes bug in getContributors())
- Add getLatestTagName() to GitHubRepository using the /tags endpoint
- Add isNewerVersion(), checkForUpdates(), and printUpdateBanner() to
  WebManager; wired into requestGitHubData() behind isCheckBentoBoxUpdates()
- LOCAL builds skip the check; colored console banner shown when outdated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
HashMap.computeIfAbsent throws ConcurrentModificationException when the
mapping function re-enters the same map (e.g. when loading a class
triggers loading another class via the same loader). Switch to
ConcurrentHashMap which handles re-entrant computeIfAbsent safely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tastybento tastybento merged commit 7da2a03 into develop Mar 8, 2026
1 check failed
@tastybento tastybento deleted the worktree-auto-update-notifications branch March 8, 2026 23:32
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