Skip to content

MIM-2712 Update pubsub utilities#290

Merged
pawlooss1 merged 1 commit into
masterfrom
update-pubsub-utilities
May 15, 2026
Merged

MIM-2712 Update pubsub utilities#290
pawlooss1 merged 1 commit into
masterfrom
update-pubsub-utilities

Conversation

@chrzaszcz
Copy link
Copy Markdown
Member

@chrzaszcz chrzaszcz commented May 13, 2026

The main goal is to allow more detailed PubSub / PEP tests including error conditions.

API changes

  1. PubSub stanza helpers no longer set top-level from or to attributes. Function arities were reduced where User was only used for from, or NodeAddr was only used for to.
  2. PubSub node names may be undefined, allowing helpers to omit node attributes and build malformed requests without manual XML manipulation.
  3. {pep, Node} and {NodeAddr, Node} targets are no longer supported; helpers now take the PubSub node name directly.
  4. Form fields no longer support the {Var, Type, Value} tuple shape; use {Var, Value} or {Var, [Value]}. Type was actually unused.
  5. Form options now distinguish [] from undefined: [] sends an empty submitted form, while undefined sends no form. This allows handling both cases.
  6. Allows producing custom publish request bodies with publish_raw/3.
  7. Accepts server JIDs in affiliations, useful for push notification tests.

Implementation notes

  • Refactors PubSub form generation around shared escalus_stanza:x_data_form/2 and field_el/3.
  • Fully supports multi-value form fields.

@chrzaszcz chrzaszcz changed the title Update pubsub utilities MIM-2712 Update pubsub utilities May 14, 2026
- Remove top-level from/to attributes from PubSub stanza helpers
- Allow undefined PubSub node names to build malformed requests
- Drop {pep, Node} and {NodeAddr, Node} PubSub targets
- Remove unsupported {Var, Type, Value} form field tuples
- Distinguish empty submitted forms from omitted forms
- Add publish_raw/3 for custom publish request bodies
- Accept server JIDs in affiliation payloads
@chrzaszcz chrzaszcz force-pushed the update-pubsub-utilities branch from f50a837 to 87aa8da Compare May 14, 2026 13:19
@chrzaszcz chrzaszcz changed the title MIM-2712 Update pubsub utilities MIM-2719 Update pubsub utilities May 15, 2026
@chrzaszcz chrzaszcz changed the title MIM-2719 Update pubsub utilities MIM-2712 Update pubsub utilities May 15, 2026
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 👍

@pawlooss1 pawlooss1 merged commit 732c569 into master May 15, 2026
2 checks passed
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