Skip to content

MIM-2733 PEP item deletion#4723

Open
chrzaszcz wants to merge 7 commits into
feature/pubsubfrom
pep-item-deletion
Open

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

Conversation

@chrzaszcz
Copy link
Copy Markdown
Member

@chrzaszcz chrzaszcz commented May 26, 2026

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

- Reuse types
- Simplify parsing
@mongoose-im
Copy link
Copy Markdown
Collaborator

mongoose-im commented May 26, 2026

CircleCI results for 39e17fa


small_tests_legacy / small_tests / cdd4fd9
Reports root / small


small_tests_latest / small_tests / cdd4fd9
Reports root / small


small_tests_latest_arm64 / small_tests / cdd4fd9
Reports root / small


ldap_mnesia_latest / ldap_mnesia / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 2275 / Failed: 0 / User-skipped: 1535 / Auto-skipped: 0


internal_mnesia_latest / internal_mnesia / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 2424 / Failed: 0 / User-skipped: 1386 / Auto-skipped: 0


dynamic_domains_pgsql_cets_legacy / pgsql_cets / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 5079 / Failed: 0 / User-skipped: 232 / Auto-skipped: 0


dynamic_domains_pgsql_cets_latest / pgsql_cets / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 5079 / Failed: 0 / User-skipped: 232 / Auto-skipped: 0


pgsql_cets_legacy / pgsql_cets / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 1357 / Failed: 0 / User-skipped: 22 / Auto-skipped: 0


pgsql_cets_latest / pgsql_cets / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 5394 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0


elasticsearch_and_cassandra_mnesia_latest / elasticsearch_and_cassandra_mnesia / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 32 / Failed: 0 / User-skipped: 0 / Auto-skipped: 0

mongoose_elasticsearch_SUITE:end_per_suite
{error,
  {{badrpc,
     {'EXIT',
       {#{what => event_already_registered,
        event_name => wpool_global_queue_lengths,
        labels => #{pool_tag => default,pool_type => elastic}},
        [{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 / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 5392 / Failed: 0 / User-skipped: 215 / Auto-skipped: 0


pgsql_redis_latest / pgsql_redis / ff6b181
Status: 🟢 Passed
Reports root/ big
OK: 5482 / Failed: 0 / User-skipped: 370 / Auto-skipped: 0


pgsql_mnesia_latest / pgsql_mnesia / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 5516 / Failed: 0 / User-skipped: 336 / Auto-skipped: 0


cockroachdb_cets_latest / cockroachdb_cets / cdd4fd9
Status: 🟢 Passed
Reports root/ big
OK: 5394 / Failed: 0 / User-skipped: 213 / Auto-skipped: 0

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

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

Additional details and impacted files
@@                Coverage Diff                 @@
##           feature/pubsub    #4723      +/-   ##
==================================================
- Coverage           86.08%   86.07%   -0.02%     
==================================================
  Files                 545      545              
  Lines               32972    33012      +40     
==================================================
+ Hits                28385    28415      +30     
- Misses               4587     4597      +10     

☔ 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.

@chrzaszcz chrzaszcz force-pushed the pep-item-deletion branch 3 times, most recently from 21e8613 to d9eeb97 Compare May 26, 2026 09:50
@chrzaszcz chrzaszcz force-pushed the pep-item-deletion branch 2 times, most recently from 3fd3567 to cbdacf8 Compare May 26, 2026 10:37
chrzaszcz added 2 commits May 26, 2026 15:14
- No batch processing yet, as there is none fo publish as well
- Support for broadcasting of item deletion notifications
@chrzaszcz chrzaszcz force-pushed the pep-item-deletion branch 2 times, most recently from 414f29f to ff6b181 Compare May 26, 2026 13:39
@chrzaszcz chrzaszcz force-pushed the pep-item-deletion branch 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
Copy link
Copy Markdown
Member

@pawlooss1 pawlooss1 left a comment

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

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