Repository navigation
Library: update badge and news read a moved project's releases - #262
Merged
elripalda merged 2 commits intoNov 17, 2026
Merged
Conversation
…your system" The Updates tab put "No build for your system" on releases that do have one (Mario Kart World v0.1.12, Hookshot v2.3.x, both with an x86_64 AppImage). Picking the file was fine; the label came from update info worked out from a different release list than the one on screen. - loadRels: a list that comes in clears S.updInfo, so the tab asks again. Before, the tab opened on the list on disk, update_info answered from that list, and the newer list fetched in the background then showed a release the answer didn't know. - askUpdInfo: an answer asked for before the list changed is dropped. - update_info: reads the releases of the project the catalog names (the ones the tab lists and installing uses), not the installed game's own repo, which still points at GitHub after a project moved (Hookshot to its own Forgejo server).
…eases The update badge (check_updates_for) and the news read the releases of the installed game's own repo. After a project moves, that's the old one: Hookshot, installed from NotRexed/Hookshot at v2.1.0, never got a badge for v2.3.2 from its Forgejo project, because the GitHub one only has nightly, rc and v2.1.0. - check_updates_for reads listed_repo (the catalog's project, as installing and the Updates tab do) and looks the catalog entry up once. - news (now news_for, so it can be tested) reads the list on disk for the same project, which is the one the update check keeps current. - The game's own repo stays until its next install: it says where the files on disk came from, and it's what the check's associations snapshot compares, so rewriting it would drop the moved game's badge.
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.
What
The Library's update badge (
check_updates_for, also used by Settings > Check for Updates) and the "What's new for your games" news (news) now read the releases of the project the catalog names for a game, not the installed game's ownrepo.Why
When a project moves, the installed game still names the old one. Hookshot moved from
NotRexed/Hookshoton GitHub toforgejo:git.notrexed.dev/Hookshot/Hookshot. A copy installed before the move hasrepo: "NotRexed/Hookshot"at v2.1.0. The GitHub project only hasnightly,rcandv2.1.0, so the badge never offered v2.3.2 (which hasHookshot-v2.3.2-x86_64.AppImageand a Windows zip), and the news never showed it. Installing (do_install,versions) already reads the catalog's project, and #260 makes the Updates tab do the same.How
check_updates_forreads releases fromlisted_repo(&g, entry): the catalog's repo, org.repowhen the catalog has none. It looks the catalog entry up once and passes it on tooffered_update.offered_updateneeds no change. The installed tag (v2.1.0) isn't in the new project's list, so it falls back to comparing versions, and v2.3.2 is newer.newsmoves intonews_for(&App)(likecheck_updates/check_updates_for), reads the catalog, and reads the release list on disk forlisted_repo. This is needed: once the update check stops refreshing the old project's list, the news would otherwise only show its stale releases.g.repois left as it is until the next install, which writes the catalog's repo. It records where the files on disk came from (v2.1.0 is still the GitHub build). It is also what theassociationscheck at the end ofcheck_updates_forcompares: if the check rewrote it, the snapshot taken at the start would no longer match and the moved game's badge would be dropped. Left alone, the check keeps dropping results only when the player corrects the project or reinstalls during the check, as before.Tests
New tests in
update_check_tests.rs, with Hookshot installed fromNotRexed/Hookshotat v2.1.0. The catalog is in the shape the site sends ("host": "forgejo","repo": "git.notrexed.dev/Hookshot/Hookshot","tag": "v2.3.2"). Both projects' release lists are on disk and fresh, using Hookshot's real file names, so nothing goes to the network.the_badge_offers_the_release_of_the_project_a_game_moved_to: offers v2.3.2. This only runs on Windows and Linux x86-64, because Hookshot has no macOS or arm64 build.the_news_shows_the_releases_of_the_project_a_game_moved_to: shows v2.3.2, not the GitHub project's releases.the_update_check_leaves_a_moved_games_own_project_until_its_next_install:repois stillNotRexed/Hookshotafter the check.With the old lookup (
g.repo), the badge test fails withNoneand the news test with["v2.1.0", "rc", "nightly"].npm test: 658 passed, 1 ignorednode --test tests/*.test.cjs: 282 passed