fix(windows-update): preserve repeated distribution keys when requesting latest downloads#91
Merged
HaloWang merged 1 commit intoRWKV-APP:devfrom Apr 16, 2026
Conversation
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
This fixes the app update request used by desktop clients when querying
/distributions/latest.The app currently percent-encodes the entire repeated
key=query string, so instead of sending:/distributions/latest?key=winZipGR&key=winHF&key=winAF&key=winGR...it sends:
/distributions/latest?key%3DwinZipGR%26key%3DwinHF%26key%3DwinAF%26key%3DwinGR...Because of that, the backend does not receive any
keyfilters and returns all platform distributions.The client then picks the highest-build
*GRasset from the full response, which can incorrectly resolve to Android APKs on Windows.Root Cause
In
lib/store/app.dart,_getLatestVersionInfo()encodes each key correctly, but then encodes the full joined query string a second time:That second
Uri.encodeComponent(queryString)is the bug.Expected vs Actual
If Apple made this mistake, what would we expect?
A macOS client should request only macOS distribution keys, receive only macOS assets, and when a direct installer is available, open that installer directly. If no direct installer is available, it should fall back to the official download website.
What actually happens when this bug exists?
The malformed request drops the platform filter. The backend responds with assets for every platform. The client then selects a highest-build GitHub Release asset from that mixed list, so a Windows x64 user can be sent to the Android APK instead of a Windows installer or zip.
Fix
Stop encoding the full joined query string. Keep only the per-key encoding:
User Impact