Skip to content

Conversation

@tassoevan
Copy link
Contributor

@tassoevan tassoevan commented Sep 2, 2025

Proposed changes (including videos or screenshots)

It performs a series of changes in client code codebase to isolate it from Meteor APIs.

  • It colocates code related to Meteor APIs under client/meteor.
  • It introduces getUserId() as a non-reactive replacement for Meteor.userId().
  • It moves startup code tied to the framework under client/meteor/startup.
  • It merges client/omnichannel and client/views/omnichannel.

Issue(s)

ARCH-1795

Steps to test or reproduce

Further comments

This PR is part of our “demeteorization” initiative.

Theoretically, the changes presented here aim to make the code to act like a facade for Meteor, isolating events and providing structures to be injected. For instance, it's delivered a Zustand store for the framework to inform the current user ID instead of watching changes on Meteor.userId() to mutate the state of UserProvider i.e. the code acts like a server for the framework rather than a dependent consumer built on top of it.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 2, 2025

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 8.2.0, but it targets 8.1.0

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 2, 2025

⚠️ No Changeset found

Latest commit: 4e4c4ce

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

@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.78%. Comparing base (d0be8ad) to head (4e4c4ce).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #36858   +/-   ##
========================================
  Coverage    67.78%   67.78%           
========================================
  Files         3449     3449           
  Lines       113987   113985    -2     
  Branches     20956    20955    -1     
========================================
+ Hits         77262    77264    +2     
+ Misses       34610    34607    -3     
+ Partials      2115     2114    -1     
Flag Coverage Δ
e2e 57.26% <50.00%> (+0.03%) ⬆️
e2e-api 42.13% <ø> (-0.06%) ⬇️

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 chore/isolate-meteor-usage branch 3 times, most recently from 8026940 to 177ebc9 Compare September 3, 2025 01:05
@tassoevan tassoevan changed the title chore: ... chore: More steps towards isolating client code from Meteor APIs Sep 3, 2025
@tassoevan tassoevan added this to the 7.11.0 milestone Sep 3, 2025
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch 6 times, most recently from 3f13333 to bfde8e6 Compare September 3, 2025 20:13
@tassoevan tassoevan requested a review from Copilot September 3, 2025 21:07

This comment was marked as outdated.

@tassoevan tassoevan requested a review from Copilot September 3, 2025 21:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR advances the "demeteorization" initiative by isolating client code from Meteor APIs and reorganizing the codebase structure. The changes introduce non-reactive replacements for Meteor methods, relocate framework-specific code, and consolidate omnichannel functionality.

Key changes:

  • Introduces getUserId() as a non-reactive replacement for Meteor.userId()
  • Colocates Meteor-specific code under client/meteor/ directory structure
  • Merges client/omnichannel and client/views/omnichannel directories

Reviewed Changes

Copilot reviewed 207 out of 265 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/ui-contexts/src/hooks/useUserId.ts Removes explicit return type annotation for useUserId hook
packages/ui-contexts/src/UserContext.ts Changes userId type from string | null to string | undefined
packages/mock-providers/src/MockedAppRootBuilder.tsx Updates mock values to use undefined instead of null for userId
apps/meteor/client/views/root/hooks/*.ts Updates import paths to reflect reorganized directory structure
apps/meteor/client/views/omnichannel/**/*.tsx Consolidates omnichannel code with updated import paths
apps/meteor/client/stores/*.ts Refactors store imports to use new modular structure
apps/meteor/client/meteor/overrides/*.ts Relocates Meteor API overrides to dedicated directory
apps/meteor/client/lib/user.ts Introduces new user state management utilities

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 15 to 16
const ThreadTitle = ({ mainMessage }: ThreadTitleProps) => {
const innerHTML = useMemo(() => ({ __html: normalizeThreadTitle(mainMessage) ?? '' }), [mainMessage]);
const me = useUser()?.username || '';
const pattern = useSetting('UTF8_User_Names_Validation', '[0-9a-zA-Z-_.]+');
const useRealName = useSetting('UI_Use_Real_Name', false);

const html = useMemo((): string => {
const message = { ...mainMessage };

if (message.msg) {
const filteredMessage = filterMarkdown(escapeHTML(message.msg));
if (!message.channels && !message.mentions) {
return filteredMessage;
}

const instance = new MentionsParser({
pattern: () => pattern,
useRealName: () => useRealName,
me: () => me,
userTemplate: ({ label }) => `<strong> ${label} </strong>`,
roomTemplate: ({ prefix, mention }) => `${prefix}<strong> ${mention} </strong>`,
});
const html = emojiParser(filteredMessage);
return instance.parse({ ...message, msg: filteredMessage, html }).html ?? '';
}

if (message.attachments) {
const attachment = message.attachments.find((attachment) => attachment.title || attachment.description);

if (attachment?.description) {
return escapeHTML(attachment.description);
}

if (attachment?.title) {
return escapeHTML(attachment.title);
}
}

return '';
}, [mainMessage, me, pattern, useRealName]);

const innerHTML = useMemo(() => ({ __html: html }), [html]);
return <ContextualbarTitle dangerouslySetInnerHTML={innerHTML} />;
};
Copy link

Copilot AI Sep 3, 2025

Choose a reason for hiding this comment

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

[nitpick] The inlined thread title normalization logic creates code duplication and increases complexity. Consider extracting this logic into a reusable utility function or custom hook to improve maintainability and reduce the component's responsibility.

Copilot uses AI. Check for mistakes.
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch from eb25f0c to 083aa7e Compare September 3, 2025 23:13
@tassoevan tassoevan marked this pull request as ready for review September 4, 2025 00:25
@tassoevan tassoevan requested review from a team as code owners September 4, 2025 00:25
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch from 083aa7e to 5cbb683 Compare September 4, 2025 17:19
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch from 5cbb683 to 6e8b70f Compare September 5, 2025 13:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 10, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/isolate-meteor-usage

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.

@tassoevan tassoevan marked this pull request as draft September 11, 2025 18:55
@dougfabris dougfabris modified the milestones: 7.11.0, 7.12.0 Sep 24, 2025
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch from a4a2081 to 87e1674 Compare October 8, 2025 22:58
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch from 87e1674 to 1c0778c Compare October 9, 2025 14:04
@dougfabris dougfabris modified the milestones: 7.12.0, 7.13.0 Oct 18, 2025
@tassoevan tassoevan force-pushed the chore/isolate-meteor-usage branch from 1c0778c to 4e4c4ce Compare December 6, 2025 02:15
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 359MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +923B
queue-worker-service 132MiB 132MiB -612B
ddp-streamer-service 126MiB 126MiB +340B
account-service 113MiB 113MiB -508B
stream-hub-service 111MiB 111MiB +106B
authorization-service 111MiB 111MiB -712B
presence-service 111MiB 111MiB -660B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/06 02:30 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 14 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-36858
  • Baseline: develop
  • Timestamp: 2025-12-06 02:30:32 UTC
  • Historical data points: 14

Updated: Sat, 06 Dec 2025 02:30:33 GMT

@dougfabris dougfabris modified the milestones: 7.13.0, 8.2.0 Jan 19, 2026
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.

4 participants