The regex in the Neynar dev portal is OR only, so we need to perform the regex expression check ourselves when we receive webhook events.
Details
- Reviewers
ashoat varun - Commits
- rCOMMd2f70e0fe779: [keyserver] add regex #createathread check
Tested on warpcast and verifying through console logging that we early exited when the proper farcaster user was tagged but didn't include #createathread in the text body.
Checked that including #createathread in several parts of the message and lowercase/uppercase did not cause the early exit
Depends on D13754
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Do we really need a RegExp if we're just checking if the string contains another string?
Maybe the best argument for RegExp would be if we're trying to match on word boundaries.
I used it for the case insensitivity option, but we could also just use .includes and undercase the cast text? Don't remember if we wanted case insensitivity with #createathread but I think it might've been mentioned at some point?
Thinking about this. I think we should likely go with a non-regex solution as this is such a simple check. Going to change in next rebase
keyserver/src/responders/farcaster-webhook-responders.js | ||
---|---|---|
18 ↗ | (On Diff #45525) |
|