Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook Test Payload different from Actual Payload | Webhook テストはペイロードが本番ペイロードと一致しません #14862

Closed
1 task done
eternal-flame-AD opened this issue Oct 28, 2024 · 1 comment · Fixed by #14863
Assignees
Labels
🐛Bug Unexpected behavior packages/backend Server side specific issue/PR

Comments

@eternal-flame-AD
Copy link
Contributor

eternal-flame-AD commented Oct 28, 2024

💡 Summary

The payload sent using the 'test' button is different from a real webhook invocation.

Webhook テストはペイロードが本番ペイロードと一致しません

🥰 Expected Behavior

Test payload should have the same data structure as the real one.

🤬 Actual Behavior

The test payload looks like: {"eventId": xxx, "body": <body>}

Example
{"server":"https://mi.yumechi.jp","hookId":"9zrajfd0cq2o01rz","userId":"9vaew1esmfme0001","eventId":"d958f07e-65bc-4af7-89e0-c38eb2edc2e7","createdAt":1730138740207,"type":"reply","body":{"id":"dummy-reply-1","createdAt":"2024-10-28T18:05:40.207Z","deletedAt":null,"text":"This is a dummy note for testing purposes.","cw":null,"userId":"dummy-user-1","user":{"id":"dummy-user-1","name":"DummyUser1","username":"dummy1","host":null,"avatarUrl":null,"avatarBlurhash":null,"avatarDecorations":[],"isBot":false,"isCat":true,"emojis":[],"onlineStatus":"active","badgeRoles":[]},"replyId":"dummy-note-1","renoteId":null,"isHidden":false,"visibility":"public","mentions":[],"visibleUserIds":[],"fileIds":[],"files":[],"tags":[],"poll":null,"emojis":[],"channelId":null,"channel":null,"localOnly":true,"reactionAcceptance":"likeOnly","reactionEmojis":{},"reactions":{},"reactionCount":0,"renoteCount":10,"repliesCount":5,"reactionAndUserPairCache":[],"clippedCount":0,"reply":{"id":"dummy-note-1","createdAt":"2024-10-28T18:05:40.207Z","deletedAt":null,"text":"This is a dummy note for testing purposes.","cw":null,"userId":"dummy-user-1","user":{"id":"dummy-user-1","name":"DummyUser1","username":"dummy1","host":null,"avatarUrl":null,"avatarBlurhash":null,"avatarDecorations":[],"isBot":false,"isCat":true,"emojis":[],"onlineStatus":"active","badgeRoles":[]},"replyId":null,"renoteId":null,"isHidden":false,"visibility":"public","mentions":[],"visibleUserIds":[],"fileIds":[],"files":[],"tags":[],"poll":null,"emojis":[],"channelId":null,"channel":null,"localOnly":true,"reactionAcceptance":"likeOnly","reactionEmojis":{},"reactions":{},"reactionCount":0,"renoteCount":10,"repliesCount":5,"reactionAndUserPairCache":[]},"renote":null,"myReaction":null}}

The real payload looks like {"eventId": xxx, "body": {"note": <body>}.

Example
{"server":"https://mi.yumechi.jp","hookId":"9zrajfd0cq2o01rz","userId":"9vaew1esmfme0001","eventId":"b717a3e2-fe91-4036-987d-81334ec2369d","createdAt":1730138780087,"type":"reply","body":{"note":{"id":"9zww9rso9qgo010x","createdAt":"2024-10-28T18:06:19.896Z","userId":"9vaew1esmfme0001","user":{"id":"9vaew1esmfme0001","name":"Yumechi | ゆめち | :ferris: :haskell: Wheel Inventor","username":"yume","host":null,"avatarUrl":"https://mi.yumechi.jp/proxy/avatar.webp?url=https%3A%2F%2Fmi.yumechi.jp%2Ffiles%2Fa6c26c37-ce9d-4d4f-996b-867bce841930&avatar=1","avatarBlurhash":"eIGtyd-.kB^jt7Ip-o?FM|M|0MxZxZRkNI~TIqWX%Ks.t6s.odR*xZ","avatarDecorations":[],"isBot":false,"isCat":true,"emojis":{},"onlineStatus":"online","badgeRoles":[]},"text":"test","cw":"わた婚E04","visibility":"specified","localOnly":false,"reactionAcceptance":"nonSensitiveOnly","visibleUserIds":["9vaew1esmfme0001"],"renoteCount":0,"repliesCount":0,"reactionCount":0,"reactions":{},"reactionEmojis":{},"reactionAndUserPairCache":[],"fileIds":[],"files":[],"replyId":"9zw05xzs9qgo00pa","renoteId":null,"clippedCount":0,"reply":{"id":"9zw05xzs9qgo00pa","createdAt":"2024-10-28T03:07:33.592Z","userId":"9vaew1esmfme0001","user":{"id":"9vaew1esmfme0001","name":"Yumechi | ゆめち | :ferris: :haskell: Wheel Inventor","username":"yume","host":null,"avatarUrl":"https://mi.yumechi.jp/proxy/avatar.webp?url=https%3A%2F%2Fmi.yumechi.jp%2Ffiles%2Fa6c26c37-ce9d-4d4f-996b-867bce841930&avatar=1","avatarBlurhash":"eIGtyd-.kB^jt7Ip-o?FM|M|0MxZxZRkNI~TIqWX%Ks.t6s.odR*xZ","avatarDecorations":[],"isBot":false,"isCat":true,"emojis":{},"onlineStatus":"online","badgeRoles":[]},"text":"诶好心疼。。痛苦真的是这样的 在绝望的环境里痛苦是麻木的,但实际上不知不觉中shape一个人的思维方式,让ta对这些痛苦越来越敏感\n\n有了那么一点自由以后突然被提醒自己的痛苦 立马就会回到原来的无法解脱的心境中 :blobcat_fu_sorry3:","cw":"わた婚E04","visibility":"public","localOnly":false,"reactionAcceptance":"nonSensitiveOnly","renoteCount":0,"repliesCount":0,"reactionCount":3,"reactions":{"❤":3},"reactionEmojis":{},"reactionAndUserPairCache":["9y780ob15vwvjeju/❤","9vd7pctq0z3k3jq5/❤","9zvytmeo9qgo00ma/❤"],"fileIds":["9zw05ixl9qgo00p9"],"files":[{"id":"9zw05ixl9qgo00p9","createdAt":"2024-10-28T03:07:14.073Z","name":"2024-10-27 22-07-13 1.png.webp","type":"image/webp","md5":"948492f42953c2da130e239ad5106b59","size":680294,"isSensitive":true,"blurhash":"eCF=gl-n-:_3R%9bxb4.IVa#9F-qIV4.t7?axuNGR*oe~pt6M{s;WB","properties":{"width":1219,"height":955},"url":"https://mi.yumechi.jp/files/c9fa60c3-de26-4bf7-bd2a-7cab90aa310d","thumbnailUrl":"https://mi.yumechi.jp/files/thumbnail-95b7b467-9a62-47cf-8ecc-770f3097dbde","comment":null,"folderId":null,"folder":null,"userId":"9vaew1esmfme0001","user":null}],"replyId":null,"renoteId":null}}}}⏎

Ref: eternal-flame-AD/gotify-webhook-misskey@7a93227

📝 Steps to Reproduce

  1. Press 'test'

Image

  1. Actually trigger the webhook.

  2. Compare the payload.

If you use cloudflared, you can get an 'Internet HTTP sink' easily by sudo cloudflared tunnel --url http://localhost:6060 socat tcp4-listen:6060 STDOUT

💻 Frontend Environment

Not frontend problem.

🛰 Backend Environment (for server admin)

  • Installation Method or Hosting Service: Offical docker-compose
  • Misskey: 2024.10.2-alpha.1
  • Node: docker-compose
  • PostgreSQL: docker-compose
  • Redis: docker-compose
  • OS and Architecture: x86-64

Bug also present on pari.cafe and misskey.flowers

Do you want to address this bug yourself?

  • Yes, I will patch the bug myself and send a pull request
@eternal-flame-AD eternal-flame-AD added the ⚠️bug? This might be a bug label Oct 28, 2024
@samunohito samunohito added 🐛Bug Unexpected behavior packages/backend Server side specific issue/PR and removed ⚠️bug? This might be a bug labels Oct 28, 2024
@samunohito
Copy link
Member

起票ありがとうございます。実装ミスのようです。
"Yes, I will patch the bug myself..."にチェックがありましたのでassignしました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Unexpected behavior packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants