Webhook triggered even if conditions evaluation is False
See original GitHub issueI deployed a listener using ark-core webhook :
{
"target": "http://144.202.75.170:5001/forger/logSomething",
"enabled": true,
"event": "transaction.applied",
"token": "9a83155f9ea8998f1ab0d0a952f7c213xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"conditions": [
{
"key": "amount",
"condition": "gte",
"value": "2500000000"
},
{
"key": "vendorField",
"condition": "regexp",
"value": "^arky.*$"
}
],
"id": "143e37f6-6eca-46ec-8099-ace9b09e7413"
}
The transactions bellow triggerred this webhook (I provide the log from my app to see token authorization match) : https://explorer.ark.io:8443/api/transactions/f1aa4f28eeed5565a450ba83fd511fc0e506472c12f9fa98da9e6209ec165e70
>>> data autorized - 9a83155f9ea8998f1ab0d0a952f7c213
2019-08-18 19:12 +00:00: >>> Data received :
2019-08-18 19:12 +00:00: {
2019-08-18 19:12 +00:00: "amount": "681877755",
2019-08-18 19:12 +00:00: "blockId": "b8bc0d18f2c6b5442976d1921300674bad90939bd7c786791dfd7cd081f0c63e",
2019-08-18 19:12 +00:00: "expiration": 0,
2019-08-18 19:12 +00:00: "fee": "2011076",
2019-08-18 19:12 +00:00: "id": "f1aa4f28eeed5565a450ba83fd511fc0e506472c12f9fa98da9e6209ec165e70",
2019-08-18 19:12 +00:00: "network": 23,
2019-08-18 19:12 +00:00: "recipientId": "AYaZAUGmfZ3hx8p9LWez5mYjLowBAyXu3x",
2019-08-18 19:12 +00:00: "senderPublicKey": "03d77805a7e23f8d413c3fd2202b610341d80443c047826790a4094c76749b5df4",
2019-08-18 19:12 +00:00: "sequence": 0,
2019-08-18 19:12 +00:00: "signature": "30440220661af7e736165ffc79e576c1a3fab55b05a639b0a45efa667064073b8c56bb640220726879ed59dd147b4822b7094849706a0b807611df8c747593e49126b33ea893",
2019-08-18 19:12 +00:00: "timestamp": 76054315,
2019-08-18 19:12 +00:00: "type": 0,
2019-08-18 19:12 +00:00: "version": 1
2019-08-18 19:12 +00:00: }
2019-08-18 19:12 +00:00: >>> logSomething response:
2019-08-18 19:12 +00:00: {"success": true}
2019-08-18 19:30 +00:00: >>> Data received :
2019-08-18 19:30 +00:00: {
2019-08-18 19:30 +00:00: "amount": "56695861",
2019-08-18 19:30 +00:00: "blockId": "2570b880127dc1c48951e7deebd9964294ac6e8ef67ad10998c2d71517c1ae8e",
2019-08-18 19:30 +00:00: "expiration": 0,
2019-08-18 19:30 +00:00: "fee": "1500000",
2019-08-18 19:30 +00:00: "id": "d1da70d8d5805b952571ae0776702f39dee4771a3f5498596fd15fec2cc6a698",
2019-08-18 19:30 +00:00: "network": 23,
2019-08-18 19:30 +00:00: "recipientId": "AQ9K7USynPxYezhHJmgtHLQeao7Vg3rxL8",
2019-08-18 19:30 +00:00: "secondSignature": "304402207430d77c5988f8322fd0b36d3bf78eb874016af771bd02da412597913bef859f0220665e2ec133f1f1e0543ffdef6496507926273ed21301b77ec228230df6a7adbd",
2019-08-18 19:30 +00:00: "senderPublicKey": "0371e0dabfd774b4f53fb9c5386a31ee4b3cb951529f18fdb5b8b7e21dbfb4b885",
2019-08-18 19:30 +00:00: "sequence": 32,
2019-08-18 19:30 +00:00: "signature": "3045022100c8991fd00fc708145734e4236458e05b14ad98856ba49ef1065adf436f900afe02204987ef913aec2aae23b1206c76b960f8cb6c09537c83b9983d055f887a5f9152",
2019-08-18 19:30 +00:00: "timestamp": 76054929,
2019-08-18 19:30 +00:00: "type": 0,
2019-08-18 19:30 +00:00: "vendorField": "arkship - Profit sharing, thank you!\"",
2019-08-18 19:30 +00:00: "vendorFieldHex": "61726b73686970202d2050726f6669742073686172696e672c207468616e6b20796f752122",
2019-08-18 19:30 +00:00: "version": 1
2019-08-18 19:30 +00:00: }
2019-08-18 19:30 +00:00: >>> logSomething response:
2019-08-18 19:30 +00:00: {"success": true}
Expected Behavior
In thoses transactions, amount <= "2500000000"
and their vendorFields do not match the re ^arky.*$
so they should never have triggered the webhook POST.
Context
Testing my ark-listener project : https://github.com/Moustikitos/ark-listener
Ideas
The reasons I see is that the amount comparison is done using string (see python example). I got no idea about why the regexp
did not work well.
>>> # example of string amount comparison in python
>>> "2500000000" > "681877755"
False
>>> "2500000000" < "681877755"
True
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Common Problems with Webhooks - Zapier Help
If the Zap receives an invalid payload, it may be ignored and the Zap may fail to trigger. Zapier can accept payloads that...
Read more >GitHub webhook events - AWS CodeBuild
A build is triggered if all the filters on one or more filter groups evaluate to true. When you create a filter group,...
Read more >Trigger Based Ad Rules - Marketing API
A Trigger Based Rule only checks its condition when this field is changed. A Trigger Based Rule can only have one trigger ....
Read more >Ways to trigger a Logicblock - Getting Started & How-To's
Logicblocks have two elements inside them: the condition that makes them true or false, and the actions that should be executed. In Apilio,...
Read more >GitHub: Webhook Troubleshooting - CloudBees Support
Check that "GitHub-API-User" has Admin permissions for the repo. · If GitHub Username and Password is used for GitHub plugin configuration, validate that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
https://github.com/ArkEcosystem/core/pull/2887 - Will be release on mainnet sometime next week.
I deployed a webhook using the condition
type eq 3
and nothing is triggered.Using an
amount eq 0
-based-webhook, I caught a vote transaction:In sent data,
type
type is anint
and it is register as astr
in the webhook database, could be the bug like in the amount comparison…