Skip to content

Conversation

@rocketchat-github-ci
Copy link
Collaborator

@rocketchat-github-ci rocketchat-github-ci commented Nov 7, 2025

Summary by CodeRabbit

  • Chores

    • Patch version bumps for Meteor and Apps Engine packages.
  • Bug Fixes

    • Improved debug output to show complex nested objects more clearly.
    • More reliable lead capture: safer pattern handling for emails/phones, deduplication, and more robust saving of visitor contact info.
  • Tests

    • New end-to-end lead-capture tests and test helpers to validate visitor email/phone extraction and related scenarios.

You can see below a preview of the release change log:

7.12.1

Engine versions

  • Node: 22.16.0
  • Deno: 1.43.5
  • MongoDB: 5.0, 6.0, 7.0
  • Apps-Engine: 1.57.1

Patch Changes

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

🦋 Changeset detected

Latest commit: 8cbd9bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 42 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/models Patch
@rocket.chat/apps-engine Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/media-calls Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/apps Patch
@rocket.chat/core-typings Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/rest-typings Patch
@rocket.chat/network-broker Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/license Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch

Not sure what this means? Click here to learn what changesets are.

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 7, 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 missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Adds multiple changes: new changeset files; switches apps-engine Deno runtime debug formatting from %O to util.inspect and removes the debug.Debugger constructor parameter from ProcessMessenger; changes livechat lead-capture extraction to use safe/unique regex matching and conditional saving; updates models to use $set with $setUnion; and adds test helpers and lead-capture tests.

Changes

Cohort / File(s) Change Summary
Changesets
\.changeset/bump-patch-1762512290533.md, \.changeset/real-hotels-sniff.md, \.changeset/fair-dolls-trade.md
Add new changeset entries bumping patch versions for various packages and documenting fixes (including debug log object-depth note and lead-capture fix).
Apps engine — Deno runtime
packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts
Replace %O debug formatting with util.inspect stringification; add top-level inspect alias; update multiple debug calls to use inspected strings.
Apps engine — ProcessMessenger
packages/apps-engine/src/server/runtime/deno/ProcessMessenger.ts
Remove debug.Debugger constructor parameter (constructor becomes parameterless); drop internal debug logging call in send strategy; maintain encoder → deno.stdin send path.
Livechat — lead capture hook
apps/meteor/app/livechat/server/hooks/leadCapture.ts
Introduce settings-driven regex patterns, add safeMatch and uniq helpers, deduplicate matches, and call saveGuestEmailPhoneById only when matches exist.
Models — LivechatVisitors update
packages/models/src/models/LivechatVisitors.ts
Replace previous $addToSet updates with a consolidated $set using $setUnion and $ifNull; short-circuit when no values to save.
Tests — helpers & lead-capture tests
apps/meteor/tests/data/livechat/rooms.ts, apps/meteor/tests/end-to-end/api/livechat/09-visitors.ts
Add createVisitorWithCustomData helper and imports; add comprehensive lead-capture end-to-end tests covering regex settings (empty/broken/valid), duplicate handling, agent messages ignored, and combined captures; cleanup hooks and settings reset added.

Sequence Diagram(s)

sequenceDiagram
  participant Msg as Inbound Message
  participant Hook as leadCapture hook
  participant Safe as safeMatch/uniq
  participant Model as saveGuestEmailPhoneById
  participant DB as LivechatVisitors model

  Msg->>Hook: message arrives
  Hook->>Safe: run safeMatch for phone/email
  Safe-->>Hook: matchedPhones, matchedEmails
  alt matches found
    Hook->>Model: saveGuestEmailPhoneById(id, phones, emails)
    Model->>DB: $set with $setUnion / $ifNull
    DB-->>Model: update result
    Model-->>Hook: result
  else no matches
    Hook-->>Msg: continue without saving
  end
Loading
sequenceDiagram
  participant Runtime as AppsEngineDenoRuntime
  participant Messenger as ProcessMessenger
  participant Deno as Deno subprocess

  Runtime->>Runtime: inspect(message) -> debug log string
  Runtime->>Messenger: send(message)
  Messenger->>Deno: encoder.write(...)
  Messenger->>Deno: deno.stdin.write(...)
  Note over Messenger: constructor no longer receives debug.Debugger
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Pay attention to: regex behavior and error handling in safeMatch; deduplication correctness; Mongo update semantics in LivechatVisitors ($setUnion correctness and null-safety); callers/constructors of ProcessMessenger for any remaining debug injection points; test flakiness around settings changes and cleanup.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo
  • sampaiodiego

Poem

🐰 I hopped through logs and regex trails,

I nibbled bugs and patched small scales,
I trimmed a constructor, gathered each note,
Stored emails and phones from a clever quote,
Tiny carrots of code—now off I sail!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Release 7.12.1' clearly and accurately reflects the main purpose of the changeset—a release version bump—matching the PR's objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release-7.12.1

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.55%. Comparing base (05f9767) to head (8cbd9bf).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #37437      +/-   ##
==========================================
+ Coverage   66.51%   66.55%   +0.03%     
==========================================
  Files        3392     3392              
  Lines      115843   115843              
  Branches    21393    21392       -1     
==========================================
+ Hits        77052    77098      +46     
+ Misses      36113    36067      -46     
  Partials     2678     2678              
Flag Coverage Δ
e2e 57.40% <ø> (-0.01%) ⬇️
unit 71.58% <ø> (+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.

@kodiakhq kodiakhq bot requested a review from a team as a code owner November 7, 2025 16:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.changeset/real-hotels-sniff.md (1)

6-6: Consider elaborating the description slightly for clarity.

The description accurately summarizes the fix, but you might enhance it by mentioning the specific implementation detail (replacing %O debug formatting with util.inspect) or the affected module (AppsEngine Deno runtime). This helps future maintainers quickly locate the corresponding code changes.

Example revision:

-Fixes a problem in apps-engine debug logs where only 2 depth levels were displayed for objects, which is often not enough for debugging purposes
+Fixes a problem in AppsEngine Deno runtime debug logs where only 2 depth levels were displayed for objects, by replacing `%O` formatting with `util.inspect` for improved debugging visibility
packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts (1)

554-554: Optional: Remove redundant inspect() on string.

error.message is already a string, so wrapping it in inspect() is unnecessary (though harmless).

Consider simplifying:

-			this.debug('Error executing bridge method %s().%s() %s', bridgeName, bridgeMethod, inspect(error.message));
+			this.debug('Error executing bridge method %s().%s() %s', bridgeName, bridgeMethod, error.message);
📜 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 a9d02be and e6cc073.

📒 Files selected for processing (3)
  • .changeset/real-hotels-sniff.md (1 hunks)
  • packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts (10 hunks)
  • packages/apps-engine/src/server/runtime/deno/ProcessMessenger.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36942
File: apps/meteor/client/lib/e2ee/keychain.ts:148-156
Timestamp: 2025-10-16T21:09:51.816Z
Learning: In the RocketChat/Rocket.Chat repository, only platforms with native crypto.randomUUID() support are targeted, so fallback implementations for crypto.randomUUID() are not required in E2EE or cryptographic code.
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/test-cases.mdc:0-0
Timestamp: 2025-09-16T22:09:18.041Z
Learning: Use Rocket.Chat primary documentation and provided reference files for guidance
🧬 Code graph analysis (1)
packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts (1)
packages/apps-engine/src/server/runtime/deno/ProcessMessenger.ts (1)
  • ProcessMessenger (8-54)
🔇 Additional comments (5)
.changeset/real-hotels-sniff.md (1)

1-6: Well-formed changeset entry.

The changeset correctly documents the patch-level version bumps and provides a clear description of the debug logging fix. The entry aligns with the PR objective and the related runtime changes mentioned in the AI summary.

packages/apps-engine/src/server/runtime/deno/ProcessMessenger.ts (1)

15-17: LGTM! Constructor refactored correctly.

The parameterless constructor aligns with the updated instantiation at line 127 of AppsEngineDenoRuntime.ts and removes the unused debug dependency.

packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts (3)

4-4: LGTM! Inspect helper improves debug output control.

The import and helper function provide consistent, single-line formatting for complex objects in debug logs with configurable depth, addressing the debug log depth display issue mentioned in the changelog.

Also applies to: 25-25


127-127: LGTM! Instantiation matches updated constructor.

The parameterless constructor call correctly aligns with the refactored ProcessMessenger constructor signature.


184-184: LGTM! Consistent use of inspect() for complex objects.

The inspect() helper is appropriately applied to complex objects and arrays (options, environment, messages, params, data) across debug statements, providing better readability and consistent formatting.

Also applies to: 330-330, 431-431, 529-529, 649-649, 698-698

@kodiakhq kodiakhq bot requested review from a team as code owners November 7, 2025 19:54
@rocketchat-github-ci rocketchat-github-ci merged commit 8cbd9bf into master Nov 7, 2025
50 of 52 checks passed
@rocketchat-github-ci rocketchat-github-ci deleted the release-7.12.1 branch November 7, 2025 22:25
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