Skip to content

fix(api): Dynamically reload apps.json for Moonlight API if modified on disk - #5506

Open
eduardomozart wants to merge 4 commits into
LizardByte:masterfrom
eduardomozart:fix/applist-reload
Open

fix(api): Dynamically reload apps.json for Moonlight API if modified on disk#5506
eduardomozart wants to merge 4 commits into
LizardByte:masterfrom
eduardomozart:fix/applist-reload

Conversation

@eduardomozart

@eduardomozart eduardomozart commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

When apps.json is modified directly on the filesystem (e.g. by external scripts or manually in a text editor), the Moonlight client still receives the old app list because the API relies on an in-memory cache of proc::proc. This pull request fixes the issue by securely tracking the file's last_write_time in proc::refresh() and calling refresh dynamically on the /applist API endpoint, seamlessly reloading the list only if modifications have occurred.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

See our AI usage policy.

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

This adds a timestamp check in proc::refresh() and calls it from the /applist endpoint to ensure changes made to apps.json outside the Web UI are immediately reflected in Moonlight.
This adds a timestamp check in proc::refresh() and calls it from the /applist endpoint to ensure changes made to apps.json outside the Web UI are immediately reflected in Moonlight.
@eduardomozart
eduardomozart marked this pull request as ready for review August 18, 2026 05:32
@sonarqubecloud

Copy link
Copy Markdown

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.

macOS: Desync between Web UI and Moonlight API when manually editing apps.json

1 participant