Skip to content

Conversation

@sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented May 15, 2025

https://rocketchat.atlassian.net/browse/ARCH-1607

Proposed changes (including videos or screenshots)

The following error was being thrown when showing an app's icon like http://localhost:3000/api/apps/c33fa1a6-68a7-491e-bf49-9d7b99671c48/icon

W20250515-19:02:28.315(-3)? (STDERR) TypeError: v is not iterable
W20250515-19:02:28.315(-3)? (STDERR)     at Context.#newResponse (/Rocket.Chat/apps/meteor/.meteor/local/build/programs/server/packages/modules.js:24348:26)
W20250515-19:02:28.315(-3)? (STDERR)     at Context.body (/Rocket.Chat/apps/meteor/.meteor/local/build/programs/server/packages/modules.js:24361:55)
W20250515-19:02:28.315(-3)? (STDERR)     at app/api/server/router.ts:277:13
W20250515-19:02:28.315(-3)? (STDERR)     at processTicksAndRejections (node:internal/process/task_queues:105:5)
W20250515-19:02:28.315(-3)? (STDERR)     at dispatch (/Rocket.Chat/apps/meteor/.meteor/local/build/programs/server/packages/modules.js:24093:17)
W20250515-19:02:28.315(-3)? (STDERR)     at dispatch (/Rocket.Chat/apps/meteor/.meteor/local/build/programs/server/packages/modules.js:24093:17)
W20250515-19:02:28.315(-3)? (STDERR)     at /Rocket.Chat/apps/meteor/.meteor/local/build/programs/server/packages/modules.js:23992:25
W20250515-19:02:28.315(-3)? (STDERR)     at app/api/server/middlewares/honoAdapter.ts:15:18

Issue(s)

Steps to test or reproduce

Further comments

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented May 15, 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 May 15, 2025

🦋 Changeset detected

Latest commit: ee0d480

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

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

@github-actions
Copy link
Contributor

PR Preview Action v1.6.1

🚀 View preview at
https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-36009/

Built to branch gh-pages at 2025-05-15 22:30 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov
Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 64.71%. Comparing base (6d36fc2) to head (ee0d480).
Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36009      +/-   ##
===========================================
+ Coverage    64.69%   64.71%   +0.02%     
===========================================
  Files         3248     3248              
  Lines        95318    95329      +11     
  Branches     17894    17905      +11     
===========================================
+ Hits         61665    61694      +29     
+ Misses       30747    30734      -13     
+ Partials      2906     2901       -5     
Flag Coverage Δ
e2e 58.41% <ø> (-0.03%) ⬇️
unit 71.94% <90.90%> (+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.

@ggazzo ggazzo added this to the 7.7.0 milestone May 16, 2025
@ggazzo ggazzo marked this pull request as ready for review May 16, 2025 12:54
@ggazzo ggazzo requested a review from Copilot May 16, 2025 12:59
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 pull request fixes an issue where the API response for app icons was not returning a proper buffer, causing runtime errors. Key changes include:

  • Converting the Content-Length header to a string in the API response.
  • Updating test cases in router.spec.ts to validate expected response schemas.
  • Enhancing the honoAdapter middleware to correctly handle responses with different body types.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
apps/meteor/ee/server/apps/communication/rest.ts Converts the Content-Length to a string to avoid type errors.
apps/meteor/app/api/server/router.spec.ts Updates tests to ensure valid response bodies and schema validation.
apps/meteor/app/api/server/middlewares/honoAdapter.ts Adds early return for missing body and handles ReadableStream responses.
apps/meteor/app/api/server/definition.ts Extends the ResultFor type to include an optional headers property.
.changeset/polite-islands-try.md Documents the fix regarding buffer responses for app icons.

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label May 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label May 16, 2025
@ggazzo ggazzo merged commit a9043ae into develop May 16, 2025
46 of 48 checks passed
@ggazzo ggazzo deleted the fix-app-icon branch May 16, 2025 15:01
@ggazzo
Copy link
Member

ggazzo commented May 22, 2025

/backport 7.6.1

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented May 22, 2025

Sorry, I couldn't do that backport because of conflicts. Could you please solve them?

you can do so by running the following commands:

git fetch
git checkout backport-7.6.1-36009
git cherry-pick a9043ae6b58df08358403c01d4100314284ad070
// solve the conflict
git push

after that just run /backport 7.6.1 again

ggazzo added a commit that referenced this pull request May 22, 2025
Co-authored-by: Guilherme Gazzo <[email protected]>
Co-authored-by: Guilherme Gazzo <[email protected]>
@ggazzo
Copy link
Member

ggazzo commented May 22, 2025

/backport 7.6.1

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented May 22, 2025

Pull request #36060 added to Project: "Patch 7.6.1"

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