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

fix(backend): Remove Meilisearch index when notes are deleted #10988

Merged
merged 7 commits into from
Jul 8, 2023

Conversation

caipira113
Copy link
Contributor

@caipira113 caipira113 commented Jun 10, 2023

What

Resolve #11193
Added functionality to delete Meilisearch indexed notes when deleting a note.

Why

When using Meilisearch on the server, indexed notes were not being removed even when the notes were deleted. This was not ideal for both privacy and server management.

Additional info (optional)

At least in my local testing, it has been confirmed that the feature works on both local and remote.

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

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Jun 10, 2023
@codecov
Copy link

codecov bot commented Jun 10, 2023

Codecov Report

Merging #10988 (0103543) into develop (ac6d6fd) will increase coverage by 0.04%.
The diff coverage is 69.23%.

@@             Coverage Diff             @@
##           develop   #10988      +/-   ##
===========================================
+ Coverage    77.34%   77.38%   +0.04%     
===========================================
  Files          908      910       +2     
  Lines        91675    91857     +182     
  Branches      7546     7555       +9     
===========================================
+ Hits         70904    71085     +181     
- Misses       20771    20772       +1     
Impacted Files Coverage Δ
.../queue/processors/DeleteAccountProcessorService.ts 41.66% <33.33%> (-0.40%) ⬇️
packages/backend/src/core/SearchService.ts 34.39% <77.77%> (+2.16%) ⬆️
packages/backend/src/core/NoteDeleteService.ts 90.47% <81.81%> (-0.69%) ⬇️

... and 3 files with indirect coverage changes

@caipira113 caipira113 changed the title fix(backend): Include feature to delete Meilisearch index notes fix(backend): Remove Meilisearch index when notes are deleted Jun 14, 2023
@@ -114,6 +117,11 @@ export class NoteDeleteService {
}
}

for (const cascadingNote of cascadingNotes) {
await this.searchService.unindexNote(cascadingNote);
Copy link
Member

Choose a reason for hiding this comment

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

awaitする必要はないかも?

Suggested change
await this.searchService.unindexNote(cascadingNote);
this.searchService.unindexNote(cascadingNote);

@syuilo syuilo merged commit 60366a4 into misskey-dev:develop Jul 8, 2023
@syuilo
Copy link
Member

syuilo commented Jul 8, 2023

👍

@caipira113 caipira113 deleted the meili-unindexNote branch July 8, 2023 12:31
@saschanaz
Copy link
Member

Can this be tested? 🤔

slofp pushed a commit to Secineralyr/misskey.dream that referenced this pull request Jul 21, 2023
…y-dev#10988)

* fix(backend): Include feature to delete Meilisearch index notes

* Update variable name
`cascadingNotesFilter` -> `federatedLocalCascadingNotes`

* tweak

---------

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexed notes are not deleted in Meilisearch
3 participants