Skip to content

fix(ngmp): correct stats and media upload caching - #568

Open
tintinhamans wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/ngmp-cache-fix
Open

fix(ngmp): correct stats and media upload caching#568
tintinhamans wants to merge 1 commit into
GeneralsOnlineDevelopmentTeam:mainfrom
tintinhamans:arctic/ngmp-cache-fix

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Aug 20, 2026

Copy link
Copy Markdown

Player stats:

After a match, the client did not refresh its cached stats. The next match started from the same old values and submitted them as the new totals.

For example:

  • The cache contains 10 wins.
  • Match one submits 11 wins.
  • The cache still contains 10 wins.
  • Match two also submits 11 wins.
  • The correct total should be 12 wins.

This could also lose rank progress. A player could earn the 5 points needed for Corporal, but a later update could still be based on the old 4-point Private stats.

The client now refreshes the cache after a successful update. It also ignores old request results when a newer request has already updated the cache.


Screenshots and replays:

Match-end media and upload URLs did not record which match they belonged to.

For example:

Screenshot data: match 101
Upload URL: https://uploads.example.invalid/matches/100/score.png

The same issue applied to replays:

Replay data: match 202
Upload URL: https://uploads.example.invalid/matches/201/replay.rep

The client now stores a match ID alongside both the media data and its upload URL. The client uploads them only when both IDs match.


Other changes:

  • Checks whether cached stats are still fresh.
  • Keeps the last known stats available during a refresh.
  • Validates batch results before caching them.
  • Limits the size of the stats cache.
  • Initializes NGMP Elo fields to safe empty values.

@github-actions

Copy link
Copy Markdown

⚠️ Title/Commit Validation Failed

Invalid PR title:

  • fix(ngmp): correct stats and media upload caching

Invalid commit messages:

  • fix(ngmp): correct stats and upload caches
    PR titles and commit messages must follow conventional commits format:
type: Description
type(scope): Description

Allowed types: bugfix, build, chore, ci, docs, fix, feat, perf, refactor, revert, style, test, tweak, unify

See CONTRIBUTING.md for details.

@tintinhamans
tintinhamans marked this pull request as ready for review August 20, 2026 22:46
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