Skip to content

chore: chat.update response validation throwing error in dev mode#38075

Merged
kodiakhq[bot] merged 3 commits intodevelopfrom
fix/chat.update
Jan 7, 2026
Merged

chore: chat.update response validation throwing error in dev mode#38075
kodiakhq[bot] merged 3 commits intodevelopfrom
fix/chat.update

Conversation

@cardoso
Copy link
Member

@cardoso cardoso commented Jan 6, 2026

Proposed changes (including videos or screenshots)

The JSON schema generated by typia does not work well with attachments, causing errors in development mode, so this PR relaxes it.

Introduced in #37138

Clipboard - January 5, 2026 2_19 PM

Issue(s)

CORE-1608

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • API Updates
    • Modified response schemas for chat.pinMessage and chat.update endpoints to update message field validation while maintaining response structure and required fields.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 6, 2026

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 Jan 6, 2026

⚠️ No Changeset found

Latest commit: d41b68a

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
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

The PR updates response schemas for two chat API endpoints (chat.pinMessage and chat.update) by replacing the message field's reference to the IMessage schema with a generic object type, addressing a response validation error.

Changes

Cohort / File(s) Summary
Chat API Response Schemas
apps/meteor/app/api/server/v1/chat.ts
Updated 200 OK response schemas for chat.pinMessage and chat.update endpoints: changed message property from $ref: '#/components/schemas/IMessage' to type: 'object'

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • pierre-lehnen-rc

Poem

🐰 Schemas simplified with a hop and a bound,
Generic objects now safely are found,
No more circular references causing dismay,
The chat API flows in a cleaner way! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The PR includes changes to both chat.pinMessage and chat.update endpoints, though the linked issue and title focus on chat.update; the pinMessage change appears to be a related fix for consistency. Clarify whether the chat.pinMessage change is intentional and related to CORE-1608, or if it should be separated into a different PR for scope clarity.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the specific endpoint and issue (chat.update response validation error in dev mode), which aligns with the main purpose of the changeset.
Linked Issues check ✅ Passed The PR addresses the response validation error in chat.update mentioned in CORE-1608 by relaxing schema validation and changing message field from IMessage reference to generic object type.
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 fix/chat.update

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 Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.65%. Comparing base (1b92c17) to head (d41b68a).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38075      +/-   ##
===========================================
- Coverage    70.67%   70.65%   -0.03%     
===========================================
  Files         3143     3143              
  Lines       108695   108695              
  Branches     19538    19530       -8     
===========================================
- Hits         76818    76796      -22     
- Misses       29878    29895      +17     
- Partials      1999     2004       +5     
Flag Coverage Δ
e2e 60.20% <ø> (+0.01%) ⬆️
e2e-api 47.41% <ø> (-1.09%) ⬇️
unit 71.76% <ø> (+<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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📦 Docker Image Size Report

➡️ Changes

Service Current Baseline Change Percent
sum of all images 0B 0B 0B
account-service 0B 0B 0B
authorization-service 0B 0B 0B
ddp-streamer-service 0B 0B 0B
omnichannel-transcript-service 0B 0B 0B
presence-service 0B 0B 0B
queue-worker-service 0B 0B 0B
rocketchat 0B 0B 0B

📊 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/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/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "01/07 12:33 (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, 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, 0.00]
  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, 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, 0.00]
  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, 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, 0.00]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  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, 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, 0.00]
  line "queue-worker-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "rocketchat" [0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.00]
Loading

Statistics (last 30 days):

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

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

  • Tag: pr-38075
  • Baseline: develop
  • Timestamp: 2026-01-07 12:33:59 UTC
  • Historical data points: 30

Updated: Wed, 07 Jan 2026 12:33:59 GMT

@dougfabris dougfabris added this to the 8.1.0 milestone Jan 6, 2026
@dougfabris dougfabris changed the title fix: chat.update response validation chore: chat.update response validation throwing error in dev mode Jan 6, 2026
@dougfabris dougfabris marked this pull request as ready for review January 6, 2026 13:31
@dougfabris dougfabris requested a review from a team as a code owner January 6, 2026 13:31
Copy link
Contributor

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

Choose a reason for hiding this comment

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

No issues found across 1 file

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/app/api/server/v1/chat.ts (1)

219-222: Apply the same schema fix to chat.pinMessage endpoint.

Line 222 still uses { $ref: '#/components/schemas/IMessage' }, while the identical chat.update endpoint (line 294) was changed to { type: 'object' }. Since both endpoints normalize messages before returning them and both can contain attachments, the chat.pinMessage response schema should be updated consistently.

Change line 222 from:

message: { $ref: '#/components/schemas/IMessage' },

to:

message: { type: 'object' },
🤖 Fix all issues with AI Agents
In @apps/meteor/app/api/server/v1/chat.ts:
- Around line 291-294: The ajv.compile<{ message: IMessage }> in chat.update
intentionally relaxes the runtime schema (message: { type: 'object' }) while
keeping the compile-time IMessage type as a workaround for typia's
attachment/schema generation limits; update the chat.update code by adding a
clear inline comment explaining this intentional type/schema mismatch, reference
the typia limitation and that normalizeMessagesForUser ensures runtime
normalization, and mention why chat.pinMessage still uses the strict $ref
pattern; optionally add a TODO linking to an upstream typia issue so future
maintainers know to revisit and tighten the schema when typia is fixed.
📜 Review details

Configuration used: Organization 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 d3511ea and e8a7712.

📒 Files selected for processing (1)
  • apps/meteor/app/api/server/v1/chat.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

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

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/api/server/v1/chat.ts
🧠 Learnings (2)
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/app/api/server/v1/chat.ts
📚 Learning: 2025-11-19T18:20:07.720Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37419
File: packages/i18n/src/locales/en.i18n.json:918-921
Timestamp: 2025-11-19T18:20:07.720Z
Learning: Repo: RocketChat/Rocket.Chat — i18n/formatting
Learning: This repository uses a custom message formatting parser in UI blocks/messages; do not assume standard Markdown rules. For keys like Call_ended_bold, Call_not_answered_bold, Call_failed_bold, and Call_transferred_bold in packages/i18n/src/locales/en.i18n.json, retain the existing single-asterisk emphasis unless maintainers request otherwise.

Applied to files:

  • apps/meteor/app/api/server/v1/chat.ts

@cardoso cardoso added the stat: QA assured Means it has been tested and approved by a company insider label Jan 6, 2026
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 6, 2026
@kodiakhq kodiakhq bot merged commit f6d33a9 into develop Jan 7, 2026
43 checks passed
@kodiakhq kodiakhq bot deleted the fix/chat.update branch January 7, 2026 12:55
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.

3 participants