Skip to content

Conversation

@tomaszwojcikowski
Copy link
Contributor

  • Implemented supported_features/0 callback in mod_event_pusher, mod_event_pusher_http, mod_event_pusher_push, mod_event_pusher_rabbit, and mod_event_pusher_sns.
  • Added remove_domain/2 handler in mod_event_pusher_push and its backends for domain removal.
  • Updated documentation to reflect compatibility with dynamic domains and removed warnings from Modules.md and mod_event_pusher.md.
  • Added test suites for dynamic domains in dynamic_domains.spec.

This PR addresses #

Proposed changes include:

  • describe the functionality changes
  • describe new or updated tests
  • describe changes to the documentation

- Implemented `supported_features/0` callback in mod_event_pusher, mod_event_pusher_http, mod_event_pusher_push, mod_event_pusher_rabbit, and mod_event_pusher_sns.
- Added `remove_domain/2` handler in mod_event_pusher_push and its backends for domain removal.
- Updated documentation to reflect compatibility with dynamic domains and removed warnings from Modules.md and mod_event_pusher.md.
- Added test suites for dynamic domains in dynamic_domains.spec.
@mongoose-im
Copy link
Collaborator

mongoose-im commented Jan 21, 2026

CircleCI results for 969a63f


elasticsearch_and_cassandra_latest / elasticsearch_and_cassandra_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 683 / Failed: 0 / User-skipped: 72 / Auto-skipped: 0


ldap_mnesia_latest / ldap_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 2395 / Failed: 0 / User-skipped: 1415 / Auto-skipped: 0


small_tests_legacy / small_tests / cf55d1c
Reports root / small


small_tests_latest / small_tests / cf55d1c
Reports root / small


small_tests_latest_arm64 / small_tests / cf55d1c
Reports root / small


ldap_mnesia_legacy / ldap_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 2395 / Failed: 0 / User-skipped: 1415 / Auto-skipped: 0


internal_mnesia_latest / internal_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 2543 / Failed: 0 / User-skipped: 1267 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_latest / pgsql_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5349 / Failed: 0 / User-skipped: 122 / Auto-skipped: 0


dynamic_domains_mysql_redis_latest / mysql_redis / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5314 / Failed: 0 / User-skipped: 157 / Auto-skipped: 0


pgsql_cets_latest / pgsql_cets / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5397 / Failed: 0 / User-skipped: 202 / Auto-skipped: 0


cockroachdb_cets_latest / cockroachdb_cets / cf55d1c
Status: 🔴 Failed
Reports root/ big
OK: 5396 / Failed: 1 / User-skipped: 202 / Auto-skipped: 0

local_iq_SUITE:iq_group:process_iq_works_across_multiple_nodes
{error,{test_case_failed,timeout_waiting_for_result}}

Report log


mysql_redis_latest / mysql_redis / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5693 / Failed: 0 / User-skipped: 149 / Auto-skipped: 0


pgsql_mnesia_legacy / pgsql_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5700 / Failed: 0 / User-skipped: 142 / Auto-skipped: 0


pgsql_mnesia_latest / pgsql_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5700 / Failed: 0 / User-skipped: 142 / Auto-skipped: 0


dynamic_domains_pgsql_mnesia_legacy / pgsql_mnesia / cf55d1c
Status: 🟢 Passed
Reports root/ big
OK: 5349 / Failed: 0 / User-skipped: 122 / Auto-skipped: 0

@codecov
Copy link

codecov bot commented Jan 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.09%. Comparing base (31bfe0b) to head (cf55d1c).
⚠️ Report is 17 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4629      +/-   ##
==========================================
+ Coverage   86.05%   86.09%   +0.04%     
==========================================
  Files         566      566              
  Lines       33926    33947      +21     
==========================================
+ Hits        29195    29228      +33     
+ Misses       4731     4719      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomaszwojcikowski tomaszwojcikowski force-pushed the tomasz/mim-2559-event-pusher-dynamic-domains branch from 37b2015 to 8971c7b Compare January 21, 2026 16:18
@tomaszwojcikowski tomaszwojcikowski marked this pull request as ready for review January 26, 2026 09:28
@fen-pl fen-pl self-requested a review January 29, 2026 09:28
Copy link
Member

@fen-pl fen-pl left a comment

Choose a reason for hiding this comment

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

Some open questions plus improvement requests for tests.

"WHERE owner_jid = ? AND node = ? AND pubsub_jid = ?">>),
mongoose_rdbms:prepare(event_pusher_push_remove_domain, event_pusher_push_subscription,
[owner_jid],
<<"DELETE FROM event_pusher_push_subscription WHERE owner_jid LIKE ?">>),
Copy link
Member

Choose a reason for hiding this comment

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

Not that happy about the potential performance implications here too but adding a new column and asking users to migrate the table might be an overkill here...

Comment on lines 103 to 106
{ok, Services1} = mod_event_pusher_push_mnesia:get_publish_services(?HOST_TYPE, User1),
{ok, Services2} = mod_event_pusher_push_mnesia:get_publish_services(?HOST_TYPE, User2),
?assertEqual(1, length(Services1)),
?assertEqual(1, length(Services2)),
Copy link
Member

Choose a reason for hiding this comment

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

Assertions on length carry virtually no debug information in case of failure.

Suggested change
{ok, Services1} = mod_event_pusher_push_mnesia:get_publish_services(?HOST_TYPE, User1),
{ok, Services2} = mod_event_pusher_push_mnesia:get_publish_services(?HOST_TYPE, User2),
?assertEqual(1, length(Services1)),
?assertEqual(1, length(Services2)),
{ok, [_]} = mod_event_pusher_push_mnesia:get_publish_services(?HOST_TYPE, User1),
{ok, [_]} = mod_event_pusher_push_mnesia:get_publish_services(?HOST_TYPE, User2),

?assertEqual([], ServicesAfter1),
?assertEqual([], ServicesAfter2).

mnesia_remove_domain_keeps_other_domain_subscriptions(_Config) ->
Copy link
Member

Choose a reason for hiding this comment

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

Since we care about this case here, it should be also tested for RDBMS.

%% Test cases - RDBMS backend
%%--------------------------------------------------------------------

rdbms_remove_domain_calls_execute_successfully(_Config) ->
Copy link
Member

Choose a reason for hiding this comment

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

This is not an RDBMS variant for _keeps_other_domain_subscriptions


-spec select_domain_batch(mongooseim:host_type(), binary(), pos_integer()) -> [jid:literal_jid()].
select_domain_batch(HostType, LikePattern, BatchSize) ->
{selected, Rows} = mongoose_rdbms:execute_successfully(
Copy link
Member

Choose a reason for hiding this comment

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

I'm pretty sure this can be rewritten into WITH ... DELETE statement - it will significantly reduce round trips here.

%% Users are stored as 'user@domain' in owner_jid, so we use LIKE '%@domain'
LikePattern = <<"%@", Domain/binary>>,
remove_domain_batches(HostType, LikePattern, ?REMOVE_DOMAIN_BATCH_SIZE,
fun select_domain_batch/3,
Copy link
Member

Choose a reason for hiding this comment

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

This approach seems forced only to conform with the current testing approach. I'd even consider moving this check to big tests. If not, it's better to use meck to mock mongoose_rdbms call.

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.

5 participants