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

enhance(backend): 配送先が410 Goneで応答してきた場合配送停止するように #10298

Merged
merged 3 commits into from
Mar 13, 2023

Conversation

CyberRex0
Copy link
Contributor

@CyberRex0 CyberRex0 commented Mar 11, 2023

What

Resolve #9807

Why

メンテナンスコスト削減

Checklist

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

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Mar 11, 2023
@github-actions github-actions bot requested review from syuilo and tamaina March 11, 2023 13:11
@codecov
Copy link

codecov bot commented Mar 11, 2023

Codecov Report

Merging #10298 (586f4bb) into develop (7e9d3d9) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           develop   #10298      +/-   ##
===========================================
- Coverage    74.11%   74.10%   -0.02%     
===========================================
  Files          809      809              
  Lines        77565    77577      +12     
  Branches      5481     5481              
===========================================
  Hits         57491    57491              
- Misses       20074    20086      +12     
Impacted Files Coverage Δ
...nd/src/queue/processors/DeliverProcessorService.ts 21.67% <0.00%> (-1.99%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@syuilo
Copy link
Member

syuilo commented Mar 12, 2023

CHANGELOGあった方が良さそう

@CyberRex0
Copy link
Contributor Author

CHANGELOG書いた

@syuilo syuilo merged commit b18df99 into misskey-dev:develop Mar 13, 2023
@syuilo
Copy link
Member

syuilo commented Mar 13, 2023

🙏🙏

Comment on lines +118 to +129
// 相手が閉鎖していることを明示しているため、配送停止する
if (res.statusCode === 410) {
this.federatedInstanceService.fetch(host).then(i => {
this.instancesRepository.update(i.id, {
isSuspended: true,
});
this.federatedInstanceService.updateCachePartial(host, {
isSuspended: true,
});
});
return `${host} is gone`;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sharedInboxに配送して410を返されるパターンの他に、削除済みユーザー個人のinboxに配送して410を返されるパターンがあって、後者の場合はホスト全体を配送停止してはいけない。

なので、配送先がsharedInboxなのかinboxなのかをキューに持たせといて、sharedInboxへの配送が410だった場合のみ停止しないといけない。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syuilo pushed a commit that referenced this pull request Mar 14, 2023
* enhance(backend): 配送先が410 Goneで応答してきた場合配送停止するように

* Update CHANGELOG.md

* Deliverキューのデータに宛先がSharedInboxかどうかのフラグを追加

* Fix lint

* Mapを使用するように

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

Successfully merging this pull request may close these issues.

インスタンスが410 Goneを出していたら配送を止める
4 participants