Skip to content

Conversation

@lucas-a-pelegrino
Copy link
Contributor

@lucas-a-pelegrino lucas-a-pelegrino commented Sep 18, 2025

Proposed changes (including videos or screenshots)

This PR adds a deprecation warning for livechat:sendTranscript meteor method, replacing its use for the livechat/transcript endpoint.

Issue(s)

CTZ-68

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • New Features

    • Livechat transcript requests now support an optional subject field in API and UI.
  • Deprecations

    • The livechat:sendTranscript method is deprecated; use POST /v1/livechat/transcript.
  • Refactor

    • Transcript sending in the UI now calls the REST endpoint instead of the deprecated method; behavior unchanged for users.
  • Chores

    • Patch releases prepared for relevant packages and a changeset added documenting the deprecation and endpoint.

@lucas-a-pelegrino lucas-a-pelegrino added this to the 7.11.0 milestone Sep 18, 2025
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 18, 2025

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2025

🦋 Changeset detected

Latest commit: b8fa5e7

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

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

Walkthrough

Client transcript sending was migrated from a Meteor method to a REST endpoint (/v1/livechat/transcript); the server method now logs a deprecation for livechat:sendTranscript; REST typings accept an optional subject; and a changeset marks patch releases and documents the deprecation.

Changes

Cohort / File(s) Summary
Release & deprecation note
.changeset/unlucky-peas-wink.md
Adds a changeset marking patch releases for @rocket.chat/meteor and @rocket.chat/rest-typings; documents deprecation of livechat:sendTranscript and points to /v1/livechat/transcript.
Server deprecation instrumentation
apps/meteor/app/livechat/server/methods/sendTranscript.ts
Imports deprecation logger and emits a deprecation log at the start of livechat:sendTranscript. No signature or control-flow changes.
Client: switch to REST endpoint
apps/meteor/client/views/room/Header/.../QuickActions/hooks/useQuickActions.tsx, apps/meteor/client/views/room/HeaderV2/.../QuickActions/hooks/useQuickActions.tsx
Replaces useMethod('livechat:sendTranscript') with useEndpoint('POST', '/v1/livechat/transcript'); payload now sent as a single object { token, rid, email, subject }; UI behavior preserved.
REST typings update
packages/rest-typings/src/v1/omnichannel.ts
Adds subject?: string to POSTLivechatTranscriptParams and includes subject in POSTLivechatTranscriptParamsSchema (optional).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor U as User
    participant C as Client UI (QuickActions)
    participant API as REST API /v1/livechat/transcript
    participant S as Server Handler

    U->>C: Request transcript (open modal / submit)
    C->>API: POST /v1/livechat/transcript { token, rid, email, subject? }
    API->>S: Validate payload & process
    S-->>API: 200 OK / error
    API-->>C: Response
    C-->>U: Show success or error
    Note over C,API: Replaces previous Meteor method call to `livechat:sendTranscript`
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • aleksandernsilva
  • sampaiodiego
  • MartinSchoeler

Poem

A hop and a post, I bound through the air,
From method to REST with a careful flair.
An optional subject skips along, light—
Deprecation whispered in the night.
Patchy pawprints mark the trail. 🐇📨

Pre-merge checks and finishing touches

✅ 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 "chore: Adds deprecation warning on livechat:sendTranscript" is concise and clearly reflects the primary change introduced by the PR. It names the affected API and the main action (adding a deprecation warning), which matches the server change and changeset in the diff. The phrasing is specific and suitable as a single-sentence summary for history scanning.
Linked Issues Check ✅ Passed CTZ-68 requested deprecating the Meteor method livechat:sendTranscript and migrating callers to the /v1/livechat/transcript endpoint; the PR implements that by adding a deprecation logger to the server method, updating two client hooks to call the REST endpoint with a single payload object, and updating rest-typings to accept an optional subject, plus a changeset documenting the deprecation. All code changes shown are directly related to that coding objective. Therefore the PR meets the linked issue's coding-related requirements.
Out of Scope Changes Check ✅ Passed All modified files in the summary are directly tied to the deprecation and migration effort (server deprecation log, client hook replacements, REST typing change, and changeset); there are no unrelated feature additions, refactors, or edits to other modules reported. I found no evidence of out-of-scope changes in the provided summaries. Thus the PR appears free of out-of-scope modifications.
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/v7/CTZ-68

📜 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 21ee8dc and b8fa5e7.

📒 Files selected for processing (1)
  • packages/rest-typings/src/v1/omnichannel.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/rest-typings/src/v1/omnichannel.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

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

@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 66.28%. Comparing base (8f98b9c) to head (b8fa5e7).
⚠️ Report is 37 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36986      +/-   ##
===========================================
- Coverage    67.12%   66.28%   -0.85%     
===========================================
  Files         3404     3393      -11     
  Lines       117782   115448    -2334     
  Branches     21472    21280     -192     
===========================================
- Hits         79061    76521    -2540     
- Misses       36024    36314     +290     
+ Partials      2697     2613      -84     
Flag Coverage Δ
e2e 56.92% <50.00%> (-0.05%) ⬇️
unit 71.27% <ø> (-0.61%) ⬇️

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.

@lucas-a-pelegrino lucas-a-pelegrino marked this pull request as ready for review September 18, 2025 19:49
@lucas-a-pelegrino lucas-a-pelegrino requested review from a team as code owners September 18, 2025 19:49
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: 1

🧹 Nitpick comments (3)
.changeset/unlucky-peas-wink.md (1)

6-6: Fix typo and endpoint reference in the changeset note.

Spelling error and missing /v1 prefix; also align the note with the actual deprecation target.

Apply this diff:

-Adds deprecation warning on `livechat:sendTranscript` with endpoint replacing it; `livechat/trasncript`
+Adds deprecation warning on `livechat:sendTranscript`. Use the REST endpoint `POST /v1/livechat/transcript` instead.
apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx (1)

114-115: Consider adding a success toast on send to mirror request flow.

handleRequestTranscript shows a success toast; handleSendTranscript closes the modal silently. Add a success toast for consistency.

apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx (1)

112-113: Add success toast for parity with other actions.

Show a success toast after sendTranscript resolves to improve UX consistency.

📜 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 8f98b9c and 94e37e4.

📒 Files selected for processing (5)
  • .changeset/unlucky-peas-wink.md (1 hunks)
  • apps/meteor/app/livechat/server/methods/sendTranscript.ts (2 hunks)
  • apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx (1 hunks)
  • apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx (1 hunks)
  • packages/rest-typings/src/v1/omnichannel.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx (3)
apps/meteor/app/livechat/server/lib/sendTranscript.ts (1)
  • sendTranscript (31-218)
packages/ui-contexts/src/index.ts (1)
  • useEndpoint (32-32)
apps/meteor/app/livechat/server/methods/sendTranscript.ts (1)
  • token (20-45)
apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx (3)
apps/meteor/app/livechat/server/lib/sendTranscript.ts (1)
  • sendTranscript (31-218)
packages/ui-contexts/src/index.ts (1)
  • useEndpoint (32-32)
apps/meteor/app/livechat/server/methods/sendTranscript.ts (1)
  • token (20-45)
🔇 Additional comments (6)
.changeset/unlucky-peas-wink.md (1)

2-4: Patch bumps look fine.

Patch releases for @rocket.chat/meteor and @rocket.chat/rest-typings are appropriate given the backwards‑compatible changes.

apps/meteor/app/livechat/server/methods/sendTranscript.ts (1)

9-9: Import added looks correct.

methodDeprecationLogger import path is consistent with other deprecation usages.

packages/rest-typings/src/v1/omnichannel.ts (2)

2282-2286: Type updated to support subject is good.

subject?: string matches server behavior (treated as override when present).


2298-2304: Schema addition aligns with optional subject; confirm null acceptance is desired.

nullable: true allows null besides omission. Server falls back on falsy values, so this is likely fine; just confirm we want to accept explicit null.

apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx (1)

109-109: Good migration to REST.

Switching to useEndpoint('POST', '/v1/livechat/transcript') aligns with the new flow and typings.

apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx (1)

107-107: Good migration to REST.

Consistent with non‑V2 header and updated typings.

Copy link
Member

@dougfabris dougfabris left a comment

Choose a reason for hiding this comment

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

On behalf of frontend, looks good

dougfabris
dougfabris previously approved these changes Sep 18, 2025
MartinSchoeler
MartinSchoeler previously approved these changes Sep 19, 2025
@lucas-a-pelegrino lucas-a-pelegrino added the stat: QA assured Means it has been tested and approved by a company insider label Sep 23, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 23, 2025
Co-authored-by: Kevin Aleman <kaleman960@gmail.com>
@dougfabris dougfabris modified the milestones: 7.11.0, 7.12.0 Sep 24, 2025
@ggazzo ggazzo modified the milestones: 7.12.0, 7.11.0 Sep 24, 2025
@ggazzo ggazzo merged commit b74ab6f into develop Sep 24, 2025
50 checks passed
@ggazzo ggazzo deleted the chore/v7/CTZ-68 branch September 24, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants