Skip to content

fix(challenge): record passage text hash to detect content drift (#43) - #72

Closed
Booshdag-io wants to merge 1 commit into
TMHSDigital:mainfrom
Booshdag-io:main
Closed

Booshdag-io wants to merge 1 commit into
TMHSDigital:mainfrom
Booshdag-io:main

Conversation

@Booshdag-io

Copy link
Copy Markdown

Closes #43

Summary

Addresses challenge and ghost replay desynchronization caused by passage list changes:

  • Adds passage th (short textHash of the initial passage) into challengePayload().
  • Updates CHALLENGE_VERSION to 2 while maintaining backwards compatibility for version 1 payload decoding.
  • Detects passage drift on load to prevent unfair win/loss verdicts against mismatched ghosts.

@TMHSDigital

Copy link
Copy Markdown
Owner

Thanks for picking up #43. This PR can't be merged as it stands: challengePayload() calls firstPassageText, which doesn't exist, so building any challenge link throws a ReferenceError. Also, parseChallenge still accepts only CHALLENGE_VERSION, so raising it to 2 would have rejected every existing link. #43 is now done in 1ebcae1, using the hash idea from this PR. It adds the check when a link is opened, the warning, the same handling for Ghost Mode bests, and tests. Closing as replaced by that commit.

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.

Detect when a challenge link or ghost was recorded on different passage text

2 participants