Skip to content

refactor: move app/lib modules - #41926

Open
tassoevan wants to merge 1 commit into
refactor/move-app-ui-message-client-modulesfrom
refactor/move-app-lib-client-modules
Open

refactor: move app/lib modules#41926
tassoevan wants to merge 1 commit into
refactor/move-app-ui-message-client-modulesfrom
refactor/move-app-lib-client-modules

Conversation

@tassoevan

@tassoevan tassoevan commented Aug 24, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

It moves client modules from app/lib/ to client/.

Issue(s)

Steps to test or reproduce

Further comments


Stack created with GitHub Stacks CLIGive Feedback 💬

Review in cubic

Task: ARCH-2396

Summary by CodeRabbit

  • Bug Fixes
    • Improved message sending behavior by preventing empty or whitespace-only messages from being sent.
    • Added clearer handling for duplicate messages, including an explanatory notification.
    • Prevented unsupported message sending in federated rooms.
    • Preserved immediate display of outgoing messages while they are being sent, including support for threaded conversations and read-receipt settings.

@tassoevan
tassoevan requested a review from a team as a code owner August 24, 2026 20:49
@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 438b671

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

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fa92dcc1-cd2f-458b-b535-8a0857a509ef

📥 Commits

Reviewing files that changed from the base of the PR and between bfa0895 and 90dae48.

📒 Files selected for processing (6)
  • apps/meteor/app/lib/client/index.ts
  • apps/meteor/app/lib/client/methods/sendMessage.ts
  • apps/meteor/client/importPackages.ts
  • apps/meteor/client/lib/chats/flows/sendMessage.ts
  • apps/meteor/client/meteor/overrides/index.ts
  • apps/meteor/client/meteor/overrides/oauthProxy.ts
💤 Files with no reviewable changes (3)
  • apps/meteor/app/lib/client/methods/sendMessage.ts
  • apps/meteor/app/lib/client/index.ts
  • apps/meteor/client/importPackages.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (5)
  • GitHub Check: ✅ Tests Done
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
The main Rocket.Chat Meteor application resides in `apps/meteor/`; place its application code there rather than in other monorepo areas.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • apps/meteor/client/meteor/overrides/index.ts
  • apps/meteor/client/meteor/overrides/oauthProxy.ts
  • apps/meteor/client/lib/chats/flows/sendMessage.ts
Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

Files:

  • apps/meteor/client/meteor/overrides/index.ts
  • apps/meteor/client/meteor/overrides/oauthProxy.ts
  • apps/meteor/client/lib/chats/flows/sendMessage.ts
🔇 Additional comments (3)
apps/meteor/client/lib/chats/flows/sendMessage.ts (1)

6-6: LGTM!

Also applies to: 16-60

apps/meteor/client/meteor/overrides/index.ts (1)

5-10: LGTM!

apps/meteor/client/meteor/overrides/oauthProxy.ts (1)

3-3: LGTM!


Walkthrough

The client moves optimistic message handling into the chat send flow. It removes the previous helper module and updates client entry-point and OAuth override imports.

Changes

Client message flow

Layer / File(s) Summary
Local optimistic message handling
apps/meteor/client/lib/chats/flows/sendMessage.ts, apps/meteor/app/lib/client/methods/sendMessage.ts
The chat send flow now validates messages, prevents duplicates and federated-room sends, constructs optimistic IMessage values, updates message state, and caches thread messages. The previous helper module is deleted.
Client and override import wiring
apps/meteor/client/importPackages.ts, apps/meteor/app/lib/client/index.ts, apps/meteor/client/meteor/overrides/index.ts, apps/meteor/client/meteor/overrides/oauthProxy.ts
Client imports now use app/utils/client. The previous client entry-point side-effect imports are removed. The OAuth override is added and its settings import path is updated.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 90dae

This PR reorganizes client modules without supplied evidence of a behavior or production-impacting issue; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested labels: type: chore

Suggested reviewers: ggazzo

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: moving client modules from app/lib as part of a refactoring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.

Warning

Errors were encountered while retrieving linked issues.

Errors (1)
  • ARCH-2396: Request failed with status code 401

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.

@dionisio-bot

dionisio-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

@tassoevan tassoevan added this to the 8.9.0 milestone Aug 24, 2026
@tassoevan

Copy link
Copy Markdown
Member Author

/jira ARCH

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/meteor/overrides/index.ts">

<violation number="1" location="apps/meteor/client/meteor/overrides/index.ts:6">
P2: When an OAuth login starts before public settings have loaded, the newly activated `oauthProxy` wrapper calls `.replace()` on `undefined` and aborts the login flow. Make the proxy-service and proxy-host reads tolerate missing settings until the settings subscription is ready.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

import './killMeteorStream';
import './desktopInjection';
import './killMeteorStream';
import './oauthProxy';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When an OAuth login starts before public settings have loaded, the newly activated oauthProxy wrapper calls .replace() on undefined and aborts the login flow. Make the proxy-service and proxy-host reads tolerate missing settings until the settings subscription is ready.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/meteor/overrides/index.ts, line 6:

<comment>When an OAuth login starts before public settings have loaded, the newly activated `oauthProxy` wrapper calls `.replace()` on `undefined` and aborts the login flow. Make the proxy-service and proxy-host reads tolerate missing settings until the settings subscription is ready.</comment>

<file context>
@@ -1,11 +1,12 @@
-import './killMeteorStream';
 import './desktopInjection';
+import './killMeteorStream';
+import './oauthProxy';
 import './oauthRedirectUri';
 import './settings';
</file context>

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.35%. Comparing base (d1949d7) to head (438b671).

Additional details and impacted files

Impacted file tree graph

@@                               Coverage Diff                               @@
##           refactor/move-app-ui-message-client-modules   #41926      +/-   ##
===============================================================================
+ Coverage                                        69.32%   69.35%   +0.02%     
===============================================================================
  Files                                             4250     4249       -1     
  Lines                                           168580   168580              
  Branches                                         30050    30028      -22     
===============================================================================
+ Hits                                            116875   116922      +47     
+ Misses                                           46531    46491      -40     
+ Partials                                          5174     5167       -7     
Flag Coverage Δ
e2e 58.77% <66.66%> (+0.04%) ⬆️
e2e-api 46.17% <ø> (+0.28%) ⬆️
unit 71.30% <ø> (+<0.01%) ⬆️

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.

@tassoevan
tassoevan force-pushed the refactor/move-app-lib-client-modules branch from f494f71 to 6520d67 Compare August 24, 2026 21:45
@tassoevan
tassoevan force-pushed the refactor/move-app-lib-client-modules branch from 6520d67 to 90dae48 Compare August 25, 2026 03:26
@tassoevan
tassoevan force-pushed the refactor/move-app-lib-client-modules branch from 90dae48 to f30c940 Compare August 25, 2026 03:57
@tassoevan
tassoevan force-pushed the refactor/move-app-lib-client-modules branch from f30c940 to 1aa0eb1 Compare August 25, 2026 04:27
@tassoevan
tassoevan force-pushed the refactor/move-app-lib-client-modules branch from 1aa0eb1 to 438b671 Compare August 25, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant