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

refactor: simplify ap/show with DbResolver #8838

Merged
merged 2 commits into from
Jun 23, 2022

Conversation

Johann150
Copy link
Contributor

@Johann150 Johann150 commented Jun 14, 2022

What

  1. Using the existing code in DbResolver we can avoid separate code for parsing the URIs in this endpoint.
  2. Use the signed in user account for packing Notes and Users.

Why

  1. Reduce code duplication and improve maintainability.
  2. Use proper visibility checks and allow e.g. followers to see follower only notes.

I moved this to a separate pull request because I would like to reuse the code for implementing #8806.

Additional info

This commit was extracted from #8641 as a separate change (mostly 8ddc4a15515da8db9b8c1183918ebda71ec9543f) as I found this should be refactored regardless of that pull request.

As a side effect of moving those changes out to a separate commit, the try...catch statement in mergePack is introduced because of changes that will be made by #8641.

@Johann150 Johann150 added packages/backend Server side specific issue/PR 💚Refactor Rewriting code without changing behavior labels Jun 14, 2022
Using the existing code in DbResolver we can avoid separate code for
parsing the URIs in this endpoint.
@Johann150 Johann150 requested a review from syuilo June 16, 2022 10:38
@syuilo syuilo merged commit 4f4d2b7 into misskey-dev:develop Jun 23, 2022
@syuilo
Copy link
Member

syuilo commented Jun 23, 2022

🆒

@Johann150 Johann150 deleted the refactor-ap-show branch June 23, 2022 18:29
Jeder321 pushed a commit to Jeder321/misskey that referenced this pull request Jul 13, 2022
Using the existing code in DbResolver we can avoid separate code for
parsing the URIs in this endpoint.

Co-authored-by: syuilo <[email protected]>
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 💚Refactor Rewriting code without changing behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants