Skip to content

[Fix] Avoid unnecessary network refresh after Legendary operations#5672

Open
MateoGonzalezLourido wants to merge 2 commits into
Heroic-Games-Launcher:mainfrom
MateoGonzalezLourido:perf/legendary-recall-postinstall
Open

[Fix] Avoid unnecessary network refresh after Legendary operations#5672
MateoGonzalezLourido wants to merge 2 commits into
Heroic-Games-Launcher:mainfrom
MateoGonzalezLourido:perf/legendary-recall-postinstall

Conversation

@MateoGonzalezLourido

@MateoGonzalezLourido MateoGonzalezLourido commented Jun 13, 2026

Copy link
Copy Markdown
  • Adds a refreshLocal() method to LegendaryLibraryManager that refreshes the library reading only local files, skipping the legendary list network call.
  • Adds a localOnly option to RefreshOptions, LibraryManager, IPC types, and GlobalState.refreshLibrary().
  • After any Legendary operation completes or errors (install, uninstall, repair), the library refresh now uses localOnly: true. Game install state is always written to local files by Legendary before signaling completion, so the network call was redundant. Updates are excluded from this — they still trigger a full network refresh.

Problem

After any Legendary operation finished, refreshLibrary triggered a full refresh which called legendary list against the Epic Games API. This was unnecessary: install state lives in installed.json and game metadata in legendaryMetadata/*.json, both written locally by Legendary before it signals completion. The network call only serves to sync the account's game catalogue, which doesn't change as a result of local operations.

Solution

refreshLocal() calls loadGamesInAccount(), refreshInstalled(), and loadAll() — all purely local file reads — then saves the result to the library store. The localOnly flag is optional on LibraryManager so other store managers (GOG, Amazon) are unaffected. Game updates still go through the full network refresh since checkForUpdates requires up-to-date remote data.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

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.

1 participant