Skip to content

Library: update badge and news read a moved project's releases - #262

Merged
elripalda merged 2 commits into
elripalda:mainfrom
Felitendo:fix/badge-news-moved-project
Nov 17, 2026
Merged

elripalda merged 2 commits into
elripalda:mainfrom
Felitendo:fix/badge-news-moved-project

Conversation

@Felitendo

@Felitendo Felitendo commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #260: it uses that PR's listed_repo. Until #260 is merged, this branch also carries its commit; the change here is the last commit.

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 own repo.

Why

When a project moves, the installed game still names the old one. Hookshot moved from NotRexed/Hookshot on GitHub to forgejo:git.notrexed.dev/Hookshot/Hookshot. A copy installed before the move has repo: "NotRexed/Hookshot" at v2.1.0. The GitHub project only has nightly, rc and v2.1.0, so the badge never offered v2.3.2 (which has Hookshot-v2.3.2-x86_64.AppImage and 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_for reads releases from listed_repo(&g, entry): the catalog's repo, or g.repo when the catalog has none. It looks the catalog entry up once and passes it on to offered_update.
  • offered_update needs 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.
  • news moves into news_for(&App) (like check_updates / check_updates_for), reads the catalog, and reads the release list on disk for listed_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.repo is 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 the associations check at the end of check_updates_for compares: 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 from NotRexed/Hookshot at 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: repo is still NotRexed/Hookshot after the check.

With the old lookup (g.repo), the badge test fails with None and the news test with ["v2.1.0", "rc", "nightly"].

  • npm test: 658 passed, 1 ignored
  • node --test tests/*.test.cjs: 282 passed

…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.
@elripalda
elripalda merged commit 5f40f5b into elripalda:main Nov 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants