Skip to content

Conversation

@bradtgmurray
Copy link
Contributor

The wrapHandler was nesting contexts, so when adding the verification_action=check transaction ID portion it reused that same context when calling the supplied callback, which then added a new set of parameters and duplicated verification_action and others.

Also refactor checkTransactionID into it's own function so it's easier to read as it's own step, make it clear we throw away that derived context with the fields, and take advantage of defer for unlocking.

@bradtgmurray bradtgmurray requested a review from tulir December 8, 2025 19:24
log = log.With().Stringer("transaction_id", transactionID).Logger()

vh.activeTransactionsLock.Lock()
defer vh.activeTransactionsLock.Unlock()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing to use defer and changing this to return a *VerificationTransaction should be the only changes to this code after factoring it out.

Stringer("sender", evt.Sender).
Stringer("room_id", evt.RoomID).
Stringer("event_id", evt.ID).
Stringer("event_type", evt.Type).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note, this change looses the event_type key from the callback's logger. I'm not sure how useful it is (and it might be added to the context somewhere else).

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants