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

chore: Add the possibility for removing the watcher for the message collection #30381

Merged
merged 17 commits into from
Nov 23, 2023

Conversation

MarcosSpessatto
Copy link
Member

@MarcosSpessatto MarcosSpessatto commented Sep 13, 2023

Proposed changes (including videos or screenshots)

https://rocketchat.atlassian.net/browse/ARCH-1208

Issue(s)

Steps to test or reproduce

Further comments

@changeset-bot
Copy link

changeset-bot bot commented Sep 13, 2023

⚠️ No Changeset found

Latest commit: b790dd8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +7 to +12
export const listenToMessageSentEvent = (service: IServiceClass, action: (message: IMessage) => Promise<void>): void => {
if (dbWatchersDisabled) {
return service.onEvent('message.sent', (message: IMessage) => action(message));
}
return service.onEvent('watch.messages', ({ message }) => action(message));
};
Copy link
Member Author

Choose a reason for hiding this comment

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

@ggazzo @sampaiodiego I decided to create another event to handle the "manual" process of sending events instead of using the existing watch.messages.

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Merging #30381 (b790dd8) into develop (4f09b2e) will increase coverage by 4.84%.
The diff coverage is 33.33%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #30381      +/-   ##
===========================================
+ Coverage    46.31%   51.16%   +4.84%     
===========================================
  Files          766      807      +41     
  Lines        14677    15140     +463     
  Branches      2753     2820      +67     
===========================================
+ Hits          6798     7746     +948     
+ Misses        7480     6960     -520     
- Partials       399      434      +35     
Flag Coverage Δ
e2e 48.07% <33.33%> (+5.66%) ⬆️
unit 66.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@MarcosSpessatto MarcosSpessatto marked this pull request as ready for review November 3, 2023 19:32
@MarcosSpessatto MarcosSpessatto requested a review from a team as a code owner November 3, 2023 19:32
@MarcosSpessatto MarcosSpessatto requested a review from a team as a code owner November 10, 2023 22:08
@sampaiodiego sampaiodiego merged commit c95cad2 into develop Nov 23, 2023
42 checks passed
@sampaiodiego sampaiodiego deleted the chore/remove-message-db-watcher-1 branch November 23, 2023 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants