gold_snapshot is written on every PLAYER_ENTERING_WORLD, so reloads add a row each

Open Beginner friendly
#882 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
lua, python
Domain
backend, testing

Research direction

Read addon/modules/gold.lua around writeSnapshot(true) and inspect repeat_events_contract.py for the skipped gold_snapshot assertion. Reproduce the repeated PLAYER_ENTERING_WORLD events with unchanged balance, then check that the one-minute limit prevents duplicate rows while a changed balance still forces a snapshot. Done when the assertion is enabled and passes.

Written by the indexing model from the issue text.

Description

addon bug night-shift

Found by the repeat-events contract (#797): writeSnapshot(true) in addon/modules/gold.lua runs on every PLAYER_ENTERING_WORLD, skipping the one-minute limit, so three reloads in a minute write three gold_snapshot rows with the same balance. Observed 3 rows for 3 events with unchanged data.

Fix: apply the one-minute limit to the login snapshot too (keep the forced write only when the balance changed since the last snapshot), and un-skip the gold_snapshot assertion in repeat_events_contract.py. Size S.

Dominant language
TypeScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from CDVolvik/everloot

All issues in CDVolvik/everloot

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.