Skip to content

fix: ignore undefined fields signature#1048

Merged
chedieck merged 1 commit intomasterfrom
fix/payload_signature
Aug 25, 2025
Merged

fix: ignore undefined fields signature#1048
chedieck merged 1 commit intomasterfrom
fix/payload_signature

Conversation

@lissavxo
Copy link
Collaborator

Related to #1047

Description

Ignore undefined fields when creating signature payload to remove the + sign in the beginning of the signature payload

Test plan

Create a POST trigger with txid, timestamp, and signature fields check if the signature payload fields does not have an extra + in the beginning

@Klakurka Klakurka requested review from chedieck and Copilot August 20, 2025 20:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes an issue where undefined, null, or empty fields were being included in signature payload generation, causing unwanted '+' signs at the beginning of the signature payload string.

  • Filter out undefined, null, and empty string values before joining signature payload components
  • Extract the mapping result to a variable for cleaner filtering logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
return valueString
}).join('+')
}).filter(value => value !== undefined && value !== null && value !== '')
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

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

[nitpick] The filter condition can be simplified using a more concise truthy check. Consider using .filter(Boolean) or .filter(value => value) instead of explicitly checking for undefined, null, and empty string, as these are all falsy values.

Suggested change
}).filter(value => value !== undefined && value !== null && value !== '')
}).filter(Boolean)

Copilot uses AI. Check for mistakes.
@chedieck chedieck merged commit 11af13c into master Aug 25, 2025
2 checks passed
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.

3 participants