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

OF-1574: Add support for XEP-0352: Client State Indication #2237

Merged

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented Aug 20, 2023

With this commit:

  • the 'active' and 'inactive' commands of CSI are recognized by Openfire;
  • the feature is advertised to clients;
  • the current client state is displayed on the session details in the admin console;
  • sessions that are resumed through Stream Management are automatically activated.

No actual optimizations have been implemented as of yet.

The implementation is loosely based on the implementation of Stream Management.

This new feature can be disabled by setting the property xmpp.client.csi.enabled to false

With this commit:
- the 'active' and 'inactive' commands of CSI are recognized by Openfire;
- the feature is advertised to clients;
- the current client state is displayed on the session details in the admin console;
- sessions that are resumed through Stream Management are automatically activated.

No actual optimizations have been implemented as of yet.

The implementation is loosely based on the implementation of Stream Management.

This new feature can be disabled by setting the property `xmpp.client.csi.enabled` to `false`
@guusdk
Copy link
Member Author

guusdk commented Aug 20, 2023

It is somewhat silly to merge this as-is: although the framework of a feature is now implemented (it can be toggled on and off), it doesn't do anything yet.

Ideally, some kind of optimization is added, before this is merged. Note that many easy-to-think-of optimizations break the XMPP specification (which is quite strict with regards to stanza delivery order).

A feasible optimization is a delay queue (of a certain capacity, with a given maximum delay) that would be used to store stanzas for later delivery, until an 'important' stanza comes along and pushes everything through.

When a client is marked as inactive by CSI, the changes in this commit allow unimportant stanzas to be queued, rather than delivered immediately.

These changes are inspired by (but different from) Prosody's mod_csi_simple
@guusdk
Copy link
Member Author

guusdk commented Aug 20, 2023

In my second commit, I've added an optimization for inactive clients: unimportant stanzas are being delayed when a client is inactive.

Very basic testing succeed, but what remains to be tested is how this behaves when an inactive client gets disconnected and reattached through stream management. The intention is that the delayed stanzas are sent after session resumption, and the client is marked as being 'active' (the latter is being dictated by the XEP).

@guusdk guusdk merged commit 47a2673 into igniterealtime:main Aug 30, 2023
@guusdk guusdk changed the title OF-1573: Add support for XEP-0352: Client State Indication OF-1574: Add support for XEP-0352: Client State Indication Aug 30, 2023
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