Skip to content

Commit

Permalink
Merge pull request #307 from tloncorp/hm/improve-nonce-log
Browse files Browse the repository at this point in the history
reel: move stable id check higher to improve log message
  • Loading branch information
arthyn authored Jan 23, 2025
2 parents 97df4b2 + 5bb465e commit f38975d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions desk/app/reel.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,22 @@
?> =(civ src.bowl)
=+ !<(confirmation:reel vase)
=. open-describes (~(del in open-describes) nonce)
?~ md=(~(get by our-metadata) nonce)
:_ this :_ ~
%^ tell:log %crit
~[leaf+"failed to receive metadata for nonce {<nonce>}"]
~['event'^s+'Invite Creation Failed' 'flow'^s+'lure']
=/ ids=(list [id=cord =token:reel])
%+ skim
~(tap by stable-id)
|= [key=cord =token:reel]
=(nonce token)
?~ ids
:_ this :_ ~
%^ tell:log %crit
%^ tell:log %warn
~[leaf+"no stable id found for nonce {<nonce>}"]
~['event'^s+'Invite Creation Failed' 'flow'^s+'lure']
~['event'^s+'Nonce Revoked' 'flow'^s+'lure']
=* id -<.ids
?~ md=(~(get by our-metadata) nonce)
:_ this :_ ~
%^ tell:log %crit
~[leaf+"no metadata for nonce {<nonce>}"]
~['event'^s+'Invite Creation Failed' 'flow'^s+'lure']
:: update the token the id points to
=. stable-id (~(put by stable-id) id token)
:: swap out the nonce for the token in our-metadata
Expand Down
2 changes: 1 addition & 1 deletion desk/mar/reel/describe.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
++ grad %noun
++ grab
|%
++ noun (pair cord cord)
++ noun [token:reel metadata:reel]
++ json (ot:dejs:format ~[token+so:dejs:format metadata+dejs-metadata])
--
++ grow
Expand Down

0 comments on commit f38975d

Please sign in to comment.