misskey icon indicating copy to clipboard operation
misskey copied to clipboard

fix(federation): InboxにきたCreate, AnnounceのobjectがBearcaps urlだった際はスキップするように

Open tamaina opened this issue 1 year ago • 7 comments

Resolve #13608

Based on https://github.com/misskey-dev/misskey/pull/13553

Diff: https://github.com/misskey-dev/misskey/compare/lem-ann...skip-bear

What

InboxにきたCreate, AnnounceのobjectがBearcaps urlだった際はスキップするように

Why

Resolve #13608

Additional info (optional)

Checklist

  • [ ] Read the contribution guide
  • [ ] Test working in a local environment
  • [ ] (If needed) Add story of storybook
  • [ ] (If needed) Update CHANGELOG.md
  • [ ] (If possible) Add tests

tamaina avatar Mar 21 '24 17:03 tamaina

このPRによるapi.jsonの差分

差分はこちら

Get diff files from Workflow Page

github-actions[bot] avatar Mar 21 '24 17:03 github-actions[bot]

Codecov Report

Attention: Patch coverage is 3.57143% with 81 lines in your changes are missing coverage. Please review.

Project coverage is 65.07%. Comparing base (f8261a1) to head (dc564fc). Report is 593 commits behind head on develop.

Files Patch % Lines
...ges/backend/src/core/activitypub/ApInboxService.ts 2.94% 66 Missing :warning:
...kend/src/queue/processors/InboxProcessorService.ts 0.00% 11 Missing :warning:
...ckend/src/core/activitypub/models/ApNoteService.ts 0.00% 4 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##           develop   #13610       +/-   ##
============================================
- Coverage    79.95%   65.07%   -14.88%     
============================================
  Files          956      989       +33     
  Lines       108864   112508     +3644     
  Branches      8413     5808     -2605     
============================================
- Hits         87045    73220    -13825     
- Misses       21819    37847    +16028     
- Partials         0     1441     +1441     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 21 '24 17:03 codecov[bot]

エラーをstringで返すのは不自然な気がする

syuilo avatar Mar 30 '24 01:03 syuilo

エラーをstringで返すのは不自然な気がする

まず、エラー (というか恒久的エラー) は、throw Error か unrecoverable error でBullにハンドルさせているのでここでは関係なし。 ここでstring返しているのは、成功 または エラーのうち一時的エラー の内容のみ。 なので、まあstringでも不自然ではないとは思うのだわ。

あと、Bearcaps決め打ちで落とだけだと不十分で、複雑な気がするのだわ。

mei23 avatar Mar 30 '24 01:03 mei23

それも考えたけど、stringにしたのは変更量を小さくするため

IdentificalError(だっけ?)で最後にハンドリングしてるのと整合性取れない感じではある

UnrecoverableErrorクラス(Bullのやつ?Inbox独自のやつ?)を使ってハンドルするとかがよさそう?

tamaina avatar Mar 30 '24 03:03 tamaina

とりあえずnode-fetch前にprocotolチェックして4xxにすれば、少なくともスキップしてくれるかもだわ。 https://github.com/misskey-dev/misskey/compare/develop...mei23:misskey:mei-v13-send-protocol

mei23 avatar Mar 30 '24 03:03 mei23

スキップするのをstringにするかどうかは #13553 マター

tamaina avatar Mar 30 '24 11:03 tamaina

@syuilo これはマージしたい

tamaina avatar May 28 '24 05:05 tamaina

🙏

syuilo avatar May 28 '24 05:05 syuilo