Skip to content

fix(tsp-js): resolveAccept, so an accept for an invite never sent is not adopted - #250

Merged
stormer78 merged 1 commit into
feat/tsp-rev2-rev3-dual-handlerfrom
fix/tsp-js-accept-must-answer-invite
Sep 16, 2026
Merged

stormer78 merged 1 commit into
feat/tsp-rev2-rev3-dual-handlerfrom
fix/tsp-js-accept-must-answer-invite

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

This PR targets feat/tsp-rev2-rev3-dual-handler, like #249.

tsp-js ships its relationship rules as pure functions, but none of them compared an accept's Digest with the invite we sent. transition(pending, "receiveAccept") only sees the state, so a client that relied on the library's rules would adopt an accept for an invite it never sent (§7.2.2).

  • tsp-js: new resolveAccept(state, answeredDigest, ourInviteDigest) returns adopt or ignore, mirroring resolveCancel. It is exported, and the README and CHANGELOG are updated.
  • core: ensureRelationship already made this check inline, so the wallet was not affected. It now calls resolveAccept, and a new test covers an accept that names the wrong digest.

This was found by the cross-implementation TSP Rev 3 conformance suite, where it failed in 5 cases. With this branch, the suite's relationship cases pass across all 5 implementations (250/250).

Tests:

  • tsp-js npm test: 111 pass.
  • core tests/tsp.*.mjs: 33 pass.

…not adopted

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit ac7e829 into feat/tsp-rev2-rev3-dual-handler Sep 16, 2026
4 checks passed
@stormer78
stormer78 deleted the fix/tsp-js-accept-must-answer-invite branch September 16, 2026 12:24
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