Write release JSON as UTF-8 and log desktop update failures#74
Conversation
- Report no-update and failure cases from the Windows desktop updater - Write release metadata and manifests with UTF-8 no-BOM JSON output
- Update release metadata message to use plain punctuation - Keep Windows JSON UTF-8 content consistent
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a shared PowerShell helper to consistently write JSON outputs as UTF-8 (no BOM) across release/manifest scripts, and improves observability of Windows desktop update checks by reporting missing metadata and failures with context.
Changes:
- Introduce
Write-JsonFileUtf8and switch multiple scripts to use it for JSON outputs. - Add reporting/logging for “no update found” and for update-check exceptions (including archive URL and stack trace).
- Update release metadata copy to remove the trademark symbol.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/generate_update_manifest.ps1 | Switch manifest output to shared UTF-8 JSON writer |
| scripts/common_release.ps1 | Add Write-JsonFileUtf8 helper (UTF-8 without BOM) |
| scripts/build_store_release.ps1 | Switch store package info JSON output to UTF-8 writer |
| scripts/build_desktop_release.ps1 | Switch desktop release metadata JSON output to UTF-8 writer |
| release/metadata/4.3.3+87.json | Remove trademark symbol from release note text |
| lib/services/windows_desktop_update_controller.dart | Report “no update” + report failures with context |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| _reportInfoSafely( | ||
| 'No desktop update detected.', | ||
| source: 'WindowsDesktopUpdateController.checkVersion', | ||
| error: <String, Object?>{ | ||
| 'appArchiveUrl': _appArchiveUrl.toString(), | ||
| }, | ||
| ); | ||
| return; |
| 'stackTrace': stackTrace.toString(), | ||
| }, | ||
| ); | ||
| // Leave the direct installer updater silent if the remote metadata fails. |
Greptile SummaryThis PR introduces a shared
Confidence Score: 5/5Safe to merge — changes are additive logging improvements and a well-scoped UTF-8 encoding helper with no behavioral regressions. The Dart change converts a silent catch into an observable one, which is strictly an improvement. The PowerShell helper is straightforward and all three callers already dot-source common_release.ps1, so the function is always in scope. The metadata edit is cosmetic. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant Script as Release Script
participant Common as common_release.ps1
participant FS as File System
Script->>Common: . common_release.ps1 (dot-source)
Note over Common: Write-JsonFileUtf8 now available
Script->>Common: Write-JsonFileUtf8 -Value $obj -Path $path -Depth N
Common->>Common: ConvertTo-Json -Depth N
Common->>Common: new UTF8Encoding($false)
Common->>Common: GetFullPath($Path)
Common->>FS: File::WriteAllText(path, json + NewLine, utf8NoBom)
participant App as Flutter App
participant Ctrl as WindowsDesktopUpdateController
participant Updater as DesktopUpdater
participant Reporter as AppErrorReporter
App->>Ctrl: checkVersion()
Ctrl->>Updater: versionCheck(appArchiveUrl)
alt "versionResponse == null"
Updater-->>Ctrl: null
Ctrl->>Reporter: "reportInfo(No desktop update detected., {appArchiveUrl})"
Ctrl-->>App: return
else update available
Updater-->>Ctrl: ItemModel
Ctrl->>Reporter: "reportInfo(Desktop update detected., {version, ...})"
Ctrl-->>App: notifyListeners()
end
Note over Ctrl: catch (error, stackTrace)
Ctrl->>Reporter: "reportInfo(Desktop update check failed., {appArchiveUrl, error, stackTrace})"
Reviews (1): Last reviewed commit: "Remove trademark symbol from online stat..." | Re-trigger Greptile |
Summary
Testing