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

Use prepared queries in mod_event_pusher_push #3060

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

chrzaszcz
Copy link
Member

@chrzaszcz chrzaszcz commented Mar 22, 2021

  • Introduce prepared queries
  • Update the backend API to remove an unused case that would require a separate prepared query

@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #3060 (a031068) into master (8f49c41) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3060      +/-   ##
==========================================
+ Coverage   78.73%   78.77%   +0.04%     
==========================================
  Files         378      378              
  Lines       31101    31096       -5     
==========================================
+ Hits        24486    24497      +11     
+ Misses       6615     6599      -16     
Impacted Files Coverage Δ
src/event_pusher/mod_event_pusher_push.erl 95.04% <100.00%> (+2.97%) ⬆️
src/event_pusher/mod_event_pusher_push_mnesia.erl 90.62% <100.00%> (+7.76%) ⬆️
src/event_pusher/mod_event_pusher_push_rdbms.erl 97.43% <100.00%> (+7.19%) ⬆️
...bal_distrib/mod_global_distrib_hosts_refresher.erl 71.69% <0.00%> (-1.89%) ⬇️
src/pubsub/mod_pubsub_db_mnesia.erl 92.40% <0.00%> (-0.43%) ⬇️
src/mod_roster.erl 76.56% <0.00%> (-0.24%) ⬇️
src/mod_muc_log.erl 77.72% <0.00%> (ø)
src/mod_muc_room.erl 77.56% <0.00%> (+0.05%) ⬆️
src/global_distrib/mod_global_distrib_utils.erl 66.03% <0.00%> (+0.94%) ⬆️
src/mam/mod_mam_elasticsearch_arch.erl 88.39% <0.00%> (+1.78%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f49c41...a031068. Read the comment docs.

Also: split the 'disable' callback

There are two distinct use cases now:
  - disable/1 for cleanup on user removal
  - disable/3 for disabling pubsub jid with an optional node

Before it was possible to specify the node without the pubsub JID.
However, this was unused and there was no use case or test for it.
XEP-0357 also does not allow this use case.
There was no point in introducing an unused prepared query.

Other changes:
  - Minor refactoring
  - Fix type specs
@chrzaszcz chrzaszcz force-pushed the prepared-queries-event-pusher branch from 7f35e2e to ae33b21 Compare March 24, 2021 08:21
@chrzaszcz chrzaszcz marked this pull request as ready for review March 24, 2021 09:13
%% Remove account - this should disable the notifications
escalus_connection:send(Bob, escalus_stanza:remove_account()),
escalus:assert(is_iq_result, escalus:wait_for_stanza(Bob)),
Pid = mongoose_helper:get_session_pid(Bob, distributed_helper:mim()),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we first get the session PID and only then remove the account?

Copy link
Collaborator

@DenysGonchar DenysGonchar left a comment

Choose a reason for hiding this comment

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

Generally looks good, thanks for extending push_SUITE.
I just have one small comment to the new testcase

@chrzaszcz chrzaszcz force-pushed the prepared-queries-event-pusher branch from bd4bd87 to a031068 Compare March 26, 2021 10:40
Copy link
Collaborator

@DenysGonchar DenysGonchar left a comment

Choose a reason for hiding this comment

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

👍

@DenysGonchar DenysGonchar merged commit 8a4e707 into master Mar 26, 2021
@DenysGonchar DenysGonchar deleted the prepared-queries-event-pusher branch March 26, 2021 12:52
@leszke leszke added this to the 4.2.0 milestone Apr 16, 2021
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.

None yet

3 participants