Przeglądaj źródła

Fix daily build tags falsely triggering update notification

  parse_version() misclassified "0.2.2b4-daily.20260313" as a release
  because the daily suffix made the last dot-segment ("20260313") contain
  no alpha chars, bypassing prerelease detection. Strip -daily.YYYYMMDD
  suffix before parsing so daily builds compare as their base beta version.
maziggy 2 miesięcy temu
rodzic
commit
95625aa860
2 zmienionych plików z 4 dodań i 0 usunięć
  1. 1 0
      CHANGELOG.md
  2. 3 0
      backend/app/api/routes/updates.py

+ 1 - 0
CHANGELOG.md

@@ -27,6 +27,7 @@ All notable changes to Bambuddy will be documented in this file.
 
 ### Changed
 - **CI: Node.js 20 → 22** — Updated GitHub Actions workflows (`ci.yml`, `security.yml`) from Node.js 20 to Node.js 22 LTS ahead of [GitHub's Node 20 deprecation](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/).
+- **Daily Builds Falsely Trigger Update Notification** — The version parser misclassified daily build tags (e.g. `0.2.2b4-daily.20260313`) as full releases instead of betas, because the `-daily.YYYYMMDD` suffix pushed the last dot-segment to a pure number (`20260313`), bypassing the prerelease detection. Users running the same beta version saw a spurious "update available" notification after each daily build. Now strips the daily suffix before parsing.
 
 
 ## [0.2.2b3] - 2026-03-12

+ 3 - 0
backend/app/api/routes/updates.py

@@ -86,6 +86,9 @@ def parse_version(version: str) -> tuple:
     # Remove 'v' prefix if present
     version = version.lstrip("v")
 
+    # Strip daily build suffix (e.g., "0.2.2b4-daily.20260313" -> "0.2.2b4")
+    version = re.sub(r"-daily\.\d+$", "", version)
+
     # Match version pattern: major.minor.patch[.micro][b|beta|alpha|rc]N
     match = re.match(r"(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?(?:b|beta|alpha|rc)?(\d+)?", version)