muc, bookmarks: do not let autojoin recreate a destroyed room #27
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/C34-destroyed-room-autojoin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What and why
A room destroyed with
destroy_roomkept its autojoin bookmark. At the nextsign-in, autojoin sent the join presence even though the room's disco#info
answered
item-not-found, so the server made the room again: empty, ours,with its default configuration (interop issue 1, C34; XEP-0045 §10.9,
XEP-0402).
destroy_roomisanswered with a result, and on a
<destroy/>presence, including one fromanother owner and one for a MUC/Sub room. This is the same way M22
(
da2984cc) takes back an accepted invite's bookmark. The alternate venuestays in
<Destroyed>and is not joined.(autojoin at sign-in, a rejoin, another device's bookmark) now go through
muc JoinIfThere. It waits for the room's disco#info and sends nopresence if the answer is
item-not-foundorgone. The join then failsas
muc <Error> item-not-found, and bookmarks shows "Room does not exist".Joins the host asks for (
muc join,bookmarks item,force_join,accept_invite) still go out at once and may create a room.Docs: the schema's
bookmarks itemautojoin,destroy_roomand<Destroyed>entries, and the XEP-0402 row ("since 1.2.2").Choices to review:
longer recreated by autojoin.
Tests
New:
test_muc_admin:muc-destroy-room-takes-the-bookmark-backtest_muc:muc-destroy-presence-takes-the-bookmark-backtest_bookmarks:bookmarks-autojoin-skips-a-room-that-is-not-theretest_bookmarks:bookmarks-explicit-join-still-creates-a-room. Thisguards against a regression, so it also passes on develop.
The first three fail on develop. Ten existing tests that drive an autojoin
now answer the room's disco#info first.
With the fix, the whole Tcl suite runs 8130 tests: 8085 passed, 0 failed,
45 skipped.
api.py checkis clean. The server rigs were not run.Verified
anotherim-server, slot 3,
repro-C34.py. The script makes a room,bookmarks it, destroys it, signs in again, puts back a stale autojoin
bookmark, and signs in again:
error"Room does not exist"): https://dev.another.im/another-im/interop/src/branch/ai-runs-2026-11-07/runs/20261107-234035-XEP-0402-slixmpp-anotherim-serverFixes #26
Thank you for the careful fix, the repro script and the interop runs. The same bug (C34) was fixed on develop in parallel (
1aed459c, with follow-upsaa20b054andd04ed76a) and released in 1.2.2, so this PR now conflicts and has nothing left to add. Autojoin goes throughmuc JoinIfExists, and a room answering item-not-found or gone is not joined (muc <Gone>, then<Error>). One deliberate difference: on a destroy, 1.2.2 clears the bookmark's autojoin and keeps the bookmark, rather than removing it. A bookmark is synced user data, and another owner's destroy should not delete it on every device. I'm closing this as fixed in 1.2.2. If you see a case that 1.2.2 still gets wrong, please open an issue or a PR against develop.Pull request closed