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

With Openfire 4.7.0, changes to chat rooms are not applied #188

Closed
guusdk opened this issue Dec 21, 2023 · 4 comments
Closed

With Openfire 4.7.0, changes to chat rooms are not applied #188

guusdk opened this issue Dec 21, 2023 · 4 comments

Comments

@guusdk
Copy link
Member

guusdk commented Dec 21, 2023

When using the REST API to apply modifications to a MUC room (for example, add a user), then these changes do not appear to be pesisted. The REST API call that performs the modification returns without an error.

First, a query to see the current members of a MUC room named muc2 (there are none):

guus@octarine:~$ curl -X 'GET' \
  'http://localhost:9092/plugins/restapi/v1/chatrooms/muc2/members' \
  -H 'accept: */*' \
  -H 'Authorization: test'
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><members/> 

Add JID [email protected] to the collections of the MUC room:

guus@octarine:~$ curl -X 'POST' \
  'http://localhost:9092/plugins/restapi/v1/chatrooms/muc2/members/john%40example.org?servicename=conference&sendInvitations=false' \
  -H 'accept: */*' \
  -H 'Authorization: test' \
  -d ''  

In a new query for all current members of the room, it is expected to see [email protected] now, but tat does not happen:

guus@octarine:~$ curl -X 'GET' \
  'http://localhost:9092/plugins/restapi/v1/chatrooms/muc2/members' \
  -H 'accept: */*' \
  -H 'Authorization: test'
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><members/>

In the admin console, the member does not show up either.

This likely has a relation to the MUC implementation refactoring that was part of Openfire 4.7.0. In that version a new API is introduced to synchronize MUC data across a cluster.

guusdk added a commit to guusdk/openfire-restAPI-plugin that referenced this issue Dec 22, 2023
…ith MUC rooms

Since Openfire 4.7.0, a new API is available that ensures that MUC data is synchronized across Openfire cluster nodes. This commit adds support for this API.

As a result, data consistency with regards to MUC-related data (chatrooms, mostly), should improve.

This commit contains two related changes:
- Invocation of `service.syncChatRoom()` after room changes, to ensure that those changes are visible to other cluste nodes.
- Application of room-specific mutexes when rooms are interacted with.

The addition of an additional mutex typically comes with a risk of introducing a deadlock-like scenario. As a mitigation for this, a new property has been introduced that controls if the mutex is engaged when the REST API interacts with MUC rooms.

The property name is `plugin.restapi.muc.room-mutex.enabled` and is enabled by default. To prevent mutex usage, this property can be switced to `false`.
@guusdk
Copy link
Member Author

guusdk commented Jan 11, 2024

A third party has confirmed that this change has the desired functional effect.

@guusdk guusdk closed this as completed in b303cca Jan 12, 2024
@guusdk
Copy link
Member Author

guusdk commented Feb 7, 2024

@brent85 your behavior in our source repository and on our forums is erratic. Unless you give me some kind of clear indication that you are indeed a person, and not some kind of malformed AI script running wild, I'm going to consider revoking your access to our resources.

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

No branches or pull requests

2 participants
@guusdk and others