-
Notifications
You must be signed in to change notification settings - Fork 61
Conversation
✅ Deploy Preview for ubiquibot-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix your comment to have the issue number in the same line like this:
Resolves #526
Also include a link to the QA issue. Here are the instructions.
@@ -150,7 +150,17 @@ export const handleIssueClosed = async () => { | |||
const shortenRecipient = shortenEthAddress(recipient, `[ CLAIM ${priceInEth} ${tokenSymbol.toUpperCase()} ]`.length); | |||
logger.info(`Posting a payout url to the issue, url: ${payoutUrl}`); | |||
const comment = `### [ **[ CLAIM ${priceInEth} ${tokenSymbol.toUpperCase()} ]** ](${payoutUrl})\n` + "```" + shortenRecipient + "```"; | |||
const permitComments = comments.filter((content) => content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot); | |||
const permitComments = comments.filter((content) => { | |||
if (content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should only check for the base URL without query parameters
const permitComments = comments.filter((content) => content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot); | ||
const permitComments = comments.filter((content) => { | ||
if (content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot) { | ||
const url = new URL(content.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to extract the URL from the comment with RegExp because the comment will be in Markdown syntax and includes other text. The example of the comment is in line 152.
const permitComments = comments.filter((content) => { | ||
if (content.body.includes("https://pay.ubq.fi?claim=") && content.user.type == UserType.Bot) { | ||
const url = new URL(content.body); | ||
const searchParams = new URLSearchParams(url.search); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URLSearchParams are already included in the URL object so no need to parse again.
Thanks for the quick review @whilefoo |
@Sadaf-A will you finish this? |
After my other issue is resolved I'll get onto this one. |
Closing this because of inactivity |
Shouldn't the bot handle this automatically? |
Yes, it should, related issue |
Resolves #526