Skip to content

Rejected snapshot can remain in delta history and still emit events #10

Open

Description

@Wranked1

Bug

In src/bot/netPatch.ts, the patched snapshot decoder creates/fills held[recvTick] and collects snapshot events before validating WantedCrc.

On CRC mismatch it restores this.deltas, but the new held[recvTick] entry is not removed. The collected events are also emitted after the CRC check regardless of whether the snapshot was rejected.

User effect

A corrupt/rejected snapshot can:

  • become a base for later delta snapshots and cause follow-up CRC failures/state corruption;
  • emit events such as death/spawn/hammerhit even though that snapshot failed validation.

Expected

If CRC validation fails:

  • discard the just-created held[recvTick] state;
  • do not emit events from the rejected snapshot;
  • only commit history/events after CRC succeeds.

Test

Feed a delta snapshot with an intentionally wrong CRC followed by a valid delta based on the previous accepted snapshot. Verify no rejected events fire and the valid follow-up does not inherit rejected state.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions