fix: nightly update display, infinite loop, and per-user install detection (#265)#269
Merged
fix: nightly update display, infinite loop, and per-user install detection (#265)#269
Conversation
…ConditionAnalyzer (#255) ## Summary Added 47 comprehensive tests for the WeatherConditionAnalyzer module, which was previously at 0% coverage. ## Test Coverage - **Weather codes**: All Open-Meteo weather codes (clear, cloudy, fog, drizzle, rain, freezing, snow, thunderstorms) - **Temperature analysis**: Extreme cold to extreme hot thresholds - **Wind analysis**: Calm to extreme wind conditions - **Alert handling**: Severity mapping, priority selection, template override - **Priority scoring**: Base scores, temperature bonuses, wind bonuses - **Template selection**: All 7 template types (default, alert, severe_weather, temperature_extreme, wind_warning, precipitation, fog) - **Error handling**: Empty data, invalid data with graceful fallback ## Results - **Tests**: 47 new tests - **Coverage**: 0% → 98% - **All lint checks pass** Closes #254
The update available dialog showed 'Current: 0.4.3' even when running a nightly build. Now shows the nightly date (e.g. 'Current: 20260205') when a build tag is present, matching the settings dialog behavior.
The startup auto-update check in app.py had the same display bug showing '0.4.3' instead of the nightly date.
If a frozen build has no build_tag (e.g. _build_info.py failed to load) and the update channel is nightly, skip the startup auto-check. Without a build_tag, the comparison logic assumes any nightly is newer, causing a prompt loop on every restart. Users can still check manually via Help > Check for Updates.
is_portable_mode() only checked Program Files to detect installed copies. Per-user installs (e.g. %LOCALAPPDATA%\Programs) are writable and not under Program Files, so they were falsely detected as portable. This caused the updater to download the portable ZIP instead of the installer for per-user installs. Fix: check for Inno Setup uninstaller (unins*.exe) in the app directory before the Program Files check. This reliably detects installed copies regardless of install location.
Local builds via installer/build.py now automatically run generate_version.py and generate_build_info.py before PyInstaller, matching what CI does. This prevents builds with missing BUILD_TAG. New flags: --nightly Build as nightly (auto-generates nightly-YYYYMMDD tag) --tag TAG Custom build tag (e.g. nightly-20260208) Usage: python installer/build.py --nightly # Local nightly build python installer/build.py # Stable build (BUILD_TAG=None)
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.
Summary
Fixes multiple issues with the nightly update system, especially for per-user installs.
Bug Fixes
1. Version display shows '0.4.3' instead of nightly date
All three update dialogs (startup auto-check, Help menu, Settings) showed
Current: 0.4.3instead of the nightly date (e.g.20260205) when running a nightly build. Fixed by usingdisplay_versionthat prefers the nightly date when a build tag is present.2. Infinite update prompt loop on startup
If
_build_info.pyfailed to load (build_tag = None), the comparison logic assumed any nightly release was newer (return True), causing the update dialog to appear on every restart. Fixed by skipping the startup auto-check whenbuild_tagis missing and the channel is nightly. Users can still check manually via Help > Check for Updates.3. Per-user installs falsely detected as portable
is_portable_mode()only checked if the app was under%PROGRAMFILES%to detect installed copies. Per-user installs (e.g.%LOCALAPPDATA%\Programs\AccessiWeather) are writable and not under Program Files, so they were falsely detected as portable. This caused the updater to download the portable ZIP instead of the installer, leading to broken updates and the loop in bug #2.Fix: Check for Inno Setup uninstaller (
unins*.exe) in the app directory before the Program Files check. This reliably detects installed copies regardless of install location.4. Local builds missing BUILD_TAG
installer/build.pydidn't rungenerate_version.pyorgenerate_build_info.pybefore PyInstaller, so local builds always hadBUILD_TAG = None. Now auto-generates both, matching CI behavior.New flags:
--nightly— generatesnightly-YYYYMMDDbuild tag automatically--tag TAG— custom build tagRoot Cause Chain
%LOCALAPPDATA%\Programsis_portable_mode()returnsTrue(not in Program Files + writable)_build_info.pymay not load correctlybuild_tagis None → comparison says any nightly is newer → prompt loopFiles Changed
src/accessiweather/app.py— Startup update check: display version fix + loop preventionsrc/accessiweather/ui/main_window.py— Help menu update check: display version fixsrc/accessiweather/config_utils.py— Portable mode detection: uninstaller checkinstaller/build.py— Auto-generate version + build info before buildingTesting
Fixes #265