[critical] Sync pull completion silently overwrites wins that occurred during the fetch #11
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File
solitaire_engine/src/sync_plugin.rslines 206, 224–227Description
poll_pull_resultbuilds the local snapshot (build_payload) at task-spawn time (line 206) and writes back the merged result at lines 225–227. The fetch task runs in the background for multiple frames. If the player wins a game between task-spawn and task-completion,update_stats_on_winandaward_xp_on_winhave already committed the win to theStats,Achievements, andProgressresources. Whenpoll_pull_resultfires, it merges using the pre-win local snapshot and overwrites the current resources with the stale merged result — the win is silently discarded.Fix
Call
build_payloadat poll time (using the current resource values) rather than at spawn time. The async task only needs the remote payload; the local half of the merge should be read from current resources when the result arrives.