Skip to content

MIM-2733 PEP item deletion - #4723

Merged
chrzaszcz merged 7 commits into
feature/pubsubfrom
pep-item-deletion
Jun 9, 2026
Merged

MIM-2733 PEP item deletion#4723
chrzaszcz merged 7 commits into
feature/pubsubfrom
pep-item-deletion

Conversation

@chrzaszcz

@chrzaszcz chrzaszcz commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

Add item retraction support to the new mod_pubsub implementation.

This PR extends the lightweight PEP path with publisher-side item retraction, including backend support, XML parsing/reply handling, disco feature advertisement, tests, and a small Escalus update for the test helpers.

Important: big_tests temporarily is switched to a newer Escalus branch required for the retract helpers and raw retract request construction. The Escalus PR needs to be merged first.

Changes

Features

  • add publisher-side item retraction to mod_pubsub
  • delete items through the backend and RDBMS implementation
  • send retract event notifications when notify is requested
  • advertise item-deletion PubSub features in disco

XML handling

  • parse <retract/> requests in mod_pubsub_xml
  • parse the notify flag
  • build retract event notifications
  • reject malformed retract requests

As part of this, mod_pubsub_xml:parse_item_ids/1 was refactored into a shared helper. It is not needed for single-item retracts anymore, but it might be useful when batch processing is added later.

Tests and helpers

  • extend pubsub_tools with retract helpers
  • add pep_SUITE coverage for retract success and retract error conditions
  • update pep_old_SUITE for the current Escalus notify representation

Types and docs

  • export shared action/error/result types from mod_pubsub and reuse them in mod_pubsub_xml
  • document item retraction as supported in mod_pubsub

Notes

  • this PR supports single-item retraction only
  • batch processing is intentionally left out for now
  • publish/retract batch processing will be added later in a separate story

@mongoose-im

mongoose-im commented May 26, 2026

Copy link
Copy Markdown
Collaborator

CircleCI results for 39e17fa


small_tests_legacy / small_tests / 58e1004
Reports root / small


small_tests_latest / small_tests / 58e1004
Reports root / small


small_tests_latest_arm64 / small_tests / 58e1004
Reports root / small


ldap_mnesia_latest / ldap_mnesia / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 2292 / Failed: 0 / User-skipped: 1535 / Auto-skipped: 0


internal_mnesia_latest / internal_mnesia / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 2441 / Failed: 0 / User-skipped: 1386 / Auto-skipped: 0


dynamic_domains_pgsql_cets_legacy / pgsql_cets / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5096 / Failed: 0 / User-skipped: 232 / Auto-skipped: 0


dynamic_domains_pgsql_cets_latest / pgsql_cets / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5096 / Failed: 0 / User-skipped: 232 / Auto-skipped: 0


pgsql_cets_legacy / pgsql_cets / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5411 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


pgsql_cets_latest / pgsql_cets / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5411 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


elasticsearch_and_cassandra_mnesia_latest / elasticsearch_and_cassandra_mnesia / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 3110 / Failed: 0 / User-skipped: 1412 / Auto-skipped: 0

mongoose_elasticsearch_SUITE:end_per_suite
{error,
  {{badrpc,
     {'EXIT',
       {#{what => event_already_registered,
        event_name => wpool_global_queue_lengths,
        labels => #{pool_type => elastic,pool_tag => default}},
        [{mongoose_instrument,set_up,3,
           [{file,
            "/home/circleci/project/src/instrument/mongoose_instrument.erl"},
          {line,110}]},
         {lists,foreach_1,2,[{file,"lists.erl"},{line,2641}]},
         {mongoose_wpool,start,5,
           [{file,
            "/home/circleci/project/src/wpool/mongoose_wpool.erl"},
          {line,162}]},
         {mongoose_wpool,'-start_configured_pools/3-lc$^1/1-1-',1,
           [{file,
            "/home/circleci/project/src/wpool/mongoose_wpool.erl"},
          {line,129}]},
         {mongoose_wpool,start_configured_pools,1,[]}]}}},
   [{distributed_helper,rpc,
      [#{node => mongooseim@localhost},
       mongoose_wpool,start_configured_pools,
       [[#{scope => global,tag => default,type => elastic,
         opts =>
           #{strategy => best_worker,workers => 10,
           call_timeout => 5000},
         conn_opts => #{port => 9200,host => <<"localhost">>}}]]],
      [{file,
         "/home/circleci/project/big_tests/../test/common/distributed_helper.erl"},
       {line,143}]},
    {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
    {test_server,run_test_case_eval1,6,
      [{file,"test_server.erl"},{line,1393}]},
    {test_server,run_test_case_eval,9,
      [{file,"test_server.erl"},{line,1237}]}]}...

Report log


mysql_cets_latest / mysql_cets / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5409 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0


pgsql_redis_latest / pgsql_redis / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5499 / Failed: 0 / User-skipped: 370 / Auto-skipped: 0


pgsql_mnesia_latest / pgsql_mnesia / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5533 / Failed: 0 / User-skipped: 336 / Auto-skipped: 0


cockroachdb_cets_latest / cockroachdb_cets / 58e1004
Status: 🟢 Passed
Reports root/ big
OK: 5411 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0

@codecov

codecov Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.62%. Comparing base (c3623a9) to head (58e1004).
⚠️ Report is 49 commits behind head on feature/pubsub.

Additional details and impacted files
@@                Coverage Diff                 @@
##           feature/pubsub    #4723      +/-   ##
==================================================
+ Coverage           86.08%   86.62%   +0.53%     
==================================================
  Files                 545      544       -1     
  Lines               32972    32603     -369     
==================================================
- Hits                28385    28242     -143     
+ Misses               4587     4361     -226     

☔ View full report in Codecov by Harness.
📢 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.

@chrzaszcz
chrzaszcz force-pushed the pep-item-deletion branch 8 times, most recently from ff6b181 to cdd4fd9 Compare May 26, 2026 13:40
@chrzaszcz chrzaszcz changed the title Pep item deletion MIM-2733 PEP item deletion May 26, 2026
@chrzaszcz
chrzaszcz marked this pull request as ready for review May 26, 2026 14:21
@fen-pl fen-pl self-assigned this May 27, 2026
@pawlooss1
pawlooss1 self-requested a review June 8, 2026 07:38

@pawlooss1 pawlooss1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good 👍 please amend the last commit and we're good to merge

@chrzaszcz
chrzaszcz force-pushed the pep-item-deletion branch from cdd4fd9 to 947da31 Compare June 8, 2026 10:44
@chrzaszcz
chrzaszcz force-pushed the pep-item-deletion branch from 9816f06 to e6c7d1f Compare June 8, 2026 11:01
@chrzaszcz
chrzaszcz force-pushed the pep-item-deletion branch from e6c7d1f to 58e1004 Compare June 9, 2026 06:27
@chrzaszcz

Copy link
Copy Markdown
Member Author

I am merging this PR because the only changes since the approval from @pawlooss1 were clean rebases.

@chrzaszcz
chrzaszcz merged commit bce2846 into feature/pubsub Jun 9, 2026
4 checks passed
@chrzaszcz
chrzaszcz deleted the pep-item-deletion branch June 9, 2026 06:59
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.

4 participants