-
Notifications
You must be signed in to change notification settings - Fork 13k
refactor: set tshow to true for the first thread message in federated rooms #37008
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
refactor: set tshow to true for the first thread message in federated rooms #37008
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
Caution Review failedThe pull request is closed. WalkthroughReplaces bare Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Matrix as Matrix Event Handler
participant DB as Message Store / DB
participant MsgSvc as MessageService
Note over Matrix: Incoming Matrix event
alt Thread message
Matrix->>DB: fetch thread root by eventId
alt Root found
Note right of Matrix #D6EAF8: compute tshow = !threadRoot.tcount
Matrix->>MsgSvc: saveMessageFromFederation(..., thread={tmid, tshow})
MsgSvc->>DB: executeSendMessage(..., thread={tmid, tshow})
DB-->>MsgSvc: persisted
MsgSvc-->>Matrix: OK
else Root not found
Note over Matrix #FDEBD0: log warning and return early
end
else Non-thread message
Matrix->>MsgSvc: saveMessageFromFederation(..., thread=undefined)
MsgSvc->>DB: executeSendMessage(..., no thread)
DB-->>MsgSvc: persisted
MsgSvc-->>Matrix: OK
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/federation #37008 +/- ##
================================================
Coverage 69.09% 69.09%
================================================
Files 2959 2959
Lines 102190 102190
Branches 18259 18261 +2
================================================
Hits 70605 70605
Misses 29716 29716
Partials 1869 1869
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| tmid?: string; | ||
| thread?: { tmid: string; tshow: boolean }; | ||
| }): Promise<IMessage> { | ||
| const threadParams = tmid ? { tmid, tshow: true } : {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if changing this true to false, would do the whole magic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to comply with existing RC behavior we also need to check if is first thread message. if so, set tshow: true, otherwise, false
adc26b7 to
9e59006
Compare
7c6b346 to
7be3815
Compare
… rooms (#37008) Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
… rooms (#37008) Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
… rooms (#37008) Co-authored-by: Guilherme Gazzo <guilherme@gazzo.xyz>
As per FDR-126, added a check on the
threadRootMessage.tcountto identify the first message of a thread. Iftcountis missing, the message is treated as the first in the thread andtshowis set totrue, ensuring it is also sent to the main room. Otherwise, will settshowtofalse.This mirrors the Rocket.Chat behavior, where federated rooms don’t provide a checkbox to choose whether to send a thread message to the main room, but the first message of a thread is always posted there automatically.
Summary by CodeRabbit
Bug Fixes
Improvements