Skip to content

[Backport 5.1] OF-3364: Fix getMaxMessages() reporting unlimited for default-type rooms - #3486

Merged
guusdk merged 3 commits into
5.1from
backport-3485-to-5.1
Sep 8, 2026
Merged

[Backport 5.1] OF-3364: Fix getMaxMessages() reporting unlimited for default-type rooms#3486
guusdk merged 3 commits into
5.1from
backport-3485-to-5.1

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Description

Backport of #3485 to 5.1.

guusdk and others added 3 commits September 7, 2026 22:00
MUCRoomHistory.getMaxMessages() switched on the room's own HistoryStrategy type, which is always 'defaulType' (sic) for rooms that inherit their history settings. This caused the method to always return -1 (unlimited) for such rooms, regardless of the parent's actual configured maximum.

Add HistoryStrategy.resolveEffective() to walk up the parent chain to the strategy whose settings are actually in effect, and use it in getMaxMessages() so the correct type and maxNumber are reported.

(cherry picked from commit 6e867a2)
…in the future

Right now, none of the callers to addMessage or to isHistoryEnabled can have a deep hierarchy of HistoryStrategy. This refactoring uses the new implementation to ensure we can't slip the same class of bug as OF-3364 into the code again in the future.

(cherry picked from commit 3a5d411)
@guusdk
guusdk merged commit 7812472 into 5.1 Sep 8, 2026
41 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