Skip to content

Conversation

@rodrigok
Copy link
Member

@rodrigok rodrigok commented Sep 24, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when accepting direct-message invites by adding a short delay before the automatic join, resulting in smoother, more consistent entry into DM rooms.
    • Non-direct (group) invites remain immediate and unaffected.
    • Reduces intermittent failures and race conditions observed when joining DMs right after accepting an invite.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 24, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2025

⚠️ No Changeset found

Latest commit: 5dd1650

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rodrigok rodrigok added this to the 7.11.0 milestone Sep 24, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Adjusted invite handling to introduce a conditional delay before triggering room join: 2000 ms for direct-message invites (is_direct), and 0 ms for non-direct invites. No exported API surface changes.

Changes

Cohort / File(s) Summary of Changes
Federation Matrix Invite Handling
ee/packages/federation-matrix/src/api/_matrix/invite.ts
Modified join trigger timing: startJoiningRoom now delays 2000 ms when is_direct is true; otherwise triggers immediately (0 ms). No public API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor MatrixServer as Matrix Server
  participant InviteHandler as Invite Handler
  participant Joiner as startJoiningRoom

  MatrixServer->>InviteHandler: Receive invite event (includes is_direct)
  alt is_direct == true
    Note over InviteHandler: Schedule delayed join (2000 ms)
    InviteHandler->>Joiner: startJoiningRoom(roomId, delay=2000)
  else
    Note over InviteHandler: Immediate join
    InviteHandler->>Joiner: startJoiningRoom(roomId, delay=0)
  end
  Joiner-->>InviteHandler: Join attempt initiated
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • ggazzo

Poem

A ping, a pause—two seconds more,
For whispered DMs at the door.
Quick hops for rooms that aren’t so tight,
But softer steps for private night.
Thump-thump, I join with careful cheer—
A courteous rabbit, drawing near. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The provided title accurately reflects the primary change by noting that federation message invites for direct messages now have an increased delay before acceptance, matching the code update to set a 2000 ms timeout for direct invites.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/federation-backup-increase-delay-of-dm

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0cf40bd and 5dd1650.

📒 Files selected for processing (1)
  • ee/packages/federation-matrix/src/api/_matrix/invite.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • ee/packages/federation-matrix/src/api/_matrix/invite.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.29%. Comparing base (9e151c0) to head (5dd1650).
⚠️ Report is 3 commits behind head on chore/federation-backup.

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           chore/federation-backup   #37054      +/-   ##
===========================================================
- Coverage                    67.30%   67.29%   -0.01%     
===========================================================
  Files                         3342     3344       +2     
  Lines                       113648   113501     -147     
  Branches                     20757    20723      -34     
===========================================================
- Hits                         76486    76379     -107     
+ Misses                       34554    34511      -43     
- Partials                      2608     2611       +3     
Flag Coverage Δ
e2e 56.92% <ø> (-0.14%) ⬇️
unit 71.23% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rodrigok rodrigok force-pushed the chore/federation-backup-increase-delay-of-dm branch from 0cf40bd to 5dd1650 Compare September 24, 2025 20:53
@ggazzo ggazzo merged commit a90c499 into chore/federation-backup Sep 24, 2025
21 checks passed
@ggazzo ggazzo deleted the chore/federation-backup-increase-delay-of-dm branch September 24, 2025 21:08
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.

3 participants