Repository navigation
Offer the first-run update only when there is something to update - #16211
Merged
Merged
Conversation
First run sends a critical "Update System" toast as soon as the network is up, whatever the machine has pending. On a fresh 4.5.0rc1 install checkupdates reports nothing, the bar's update icon stays hidden because omarchy-update-available says Omarchy is up to date, and the toast leads to an update with nothing to do. Send it only when omarchy-update-available finds an update (Omarchy itself or a development checkout, the bar's signal) or checkupdates lists any package. checkupdates exits 2 when every package is current and 1 when it could not tell; only a definite "nothing" holds the toast back, so a failed check prompts as before.
Contributor
[Medium impact] The PR appears safe to merge; the remaining repeated package check is non-blocking.
|
| omarchy-update-available >/dev/null 2>&1 && return 0 | ||
|
|
||
| local status=0 | ||
| checkupdates --nocolor >/dev/null 2>&1 || status=$? |
Contributor
There was a problem hiding this comment.
When no Omarchy update is found, omarchy-update-available has already run checkupdates, but update_pending runs it again here to check other packages. On a current install, this repeats network requests and delays the decision to skip the toast. Reuse one package-check result for both decisions.
omarchy-update-available runs checkupdates to find Omarchy's package, and the first-run check then ran it again for the rest. Each run syncs the package databases over the network, so an install with nothing to update paid for that twice before skipping the toast. checkupdates alone covers every repository package, Omarchy's included. omarchy-update-available is still asked when OMARCHY_PATH is a development checkout, the one thing checkupdates cannot see. The test's stand-in for it now runs checkupdates as the real one does, and counts the runs.
The repository style quotes string literals in [[ ]] comparisons and prefers a full if/else over an early return that skips what follows.
AGENTS.md: runtime code relies on $OMARCHY_PATH and does not default it.
20 of 34 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First run sends a critical "Update System" toast as soon as the network is up, whatever the machine has pending. On a fresh 4.5.0rc1 install checkupdates reports nothing, the bar's update icon stays hidden because omarchy-update-available says Omarchy is up to date, and the toast leads to an update with nothing to do.
And there's really nothing new after a fresh install :)
Send it only when omarchy-update-available finds an update (Omarchy itself or a development checkout, the bar's signal) or checkupdates lists any package. checkupdates exits 2 when every package is current and 1 when it could not tell; only a definite "nothing" holds the toast back, so a failed check prompts as before.