-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Release 7.10.1 #36965
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Release 7.10.1 #36965
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cee7038
Bump 7.10.1
rocketchat-github-ci d7da2c0
fix: Iframe authentication (#36962)
dionisio-bot[bot] c8e778a
fix: imported fixes 09-18-2025 (#37000)
dionisio-bot[bot] b0c3e6a
chore: add withStream method to MockedAppRootBuilder (#37027)
dionisio-bot[bot] 42cea25
fix: less strict slash command registration condition (#37028)
dionisio-bot[bot] 5e3fd35
Update .changeset/green-ants-shop.md
ggazzo b3ebad4
fix: formatted volume out of bounds of 0 and 1 (#37041)
juliajforesti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Bump @rocket.chat/meteor version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Fixes login using iframe authentication. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Security Hotfix (https://docs.rocket.chat/docs/security-fixes-and-updates) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@rocket.chat/apps-engine': patch | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Changes a strict behavior on reporting slash commands provided by apps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@rocket.chat/meteor': patch | ||
| --- | ||
|
|
||
| Ensures the formatted volume value is kept between 0 and 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| import type { SlashCommand } from '@rocket.chat/core-typings'; | ||
| import { mockAppRoot, type StreamControllerRef } from '@rocket.chat/mock-providers'; | ||
| import { renderHook, waitFor } from '@testing-library/react'; | ||
|
|
||
| import { useAppSlashCommands } from './useAppSlashCommands'; | ||
| import { slashCommands } from '../../app/utils/client/slashCommand'; | ||
|
|
||
| const mockSlashCommands: SlashCommand[] = [ | ||
| { | ||
| command: '/test', | ||
| description: 'Test command', | ||
| params: 'param1 param2', | ||
| clientOnly: false, | ||
| providesPreview: false, | ||
| appId: 'test-app-1', | ||
| permission: undefined, | ||
| }, | ||
| { | ||
| command: '/weather', | ||
| description: 'Get weather information', | ||
| params: 'city', | ||
| clientOnly: false, | ||
| providesPreview: true, | ||
| appId: 'weather-app', | ||
| permission: undefined, | ||
| }, | ||
| ]; | ||
|
|
||
| const mockApiResponse = { | ||
| commands: mockSlashCommands, | ||
| total: mockSlashCommands.length, | ||
| }; | ||
|
|
||
| describe('useAppSlashCommands', () => { | ||
| let mockGetSlashCommands: jest.Mock; | ||
|
|
||
| beforeEach(() => { | ||
| mockGetSlashCommands = jest.fn().mockResolvedValue(mockApiResponse); | ||
|
|
||
| slashCommands.commands = {}; | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| jest.clearAllMocks(); | ||
| }); | ||
|
|
||
| it('should not fetch data when user ID is not available', () => { | ||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot().withEndpoint('GET', '/v1/commands.list', mockGetSlashCommands).build(), | ||
| }); | ||
|
|
||
| expect(mockGetSlashCommands).not.toHaveBeenCalled(); | ||
| expect(slashCommands.commands).toEqual({}); | ||
| }); | ||
|
|
||
| it('should fetch slash commands when user ID is available', async () => { | ||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot().withEndpoint('GET', '/v1/commands.list', mockGetSlashCommands).withJohnDoe().build(), | ||
| }); | ||
|
|
||
| await waitFor(() => { | ||
| expect(Object.keys(slashCommands.commands)).toHaveLength(mockSlashCommands.length); | ||
| }); | ||
| }); | ||
|
|
||
| it('should handle command/removed event by invalidating queries', async () => { | ||
| const streamRef: StreamControllerRef<'apps'> = {}; | ||
|
|
||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot() | ||
| .withJohnDoe() | ||
| .withStream('apps', streamRef) | ||
| .withEndpoint('GET', '/v1/commands.list', mockGetSlashCommands) | ||
| .build(), | ||
| }); | ||
|
|
||
| expect(streamRef.controller).toBeDefined(); | ||
|
|
||
| await waitFor(() => { | ||
| expect(Object.keys(slashCommands.commands)).toHaveLength(mockSlashCommands.length); | ||
| }); | ||
|
|
||
| streamRef.controller?.emit('apps', [['command/removed', ['/test']]]); | ||
|
|
||
| expect(slashCommands.commands['/test']).toBeUndefined(); | ||
| expect(slashCommands.commands['/weather']).toBeDefined(); | ||
| }); | ||
|
|
||
| it('should handle command/added event by invalidating queries', async () => { | ||
| const streamRef: StreamControllerRef<'apps'> = {}; | ||
|
|
||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot() | ||
| .withJohnDoe() | ||
| .withStream('apps', streamRef) | ||
| .withEndpoint('GET', '/v1/commands.list', mockGetSlashCommands) | ||
| .build(), | ||
| }); | ||
|
|
||
| expect(streamRef.controller).toBeDefined(); | ||
|
|
||
| await waitFor(() => { | ||
| expect(Object.keys(slashCommands.commands)).toHaveLength(mockSlashCommands.length); | ||
| }); | ||
|
|
||
| mockGetSlashCommands.mockResolvedValue({ | ||
| commands: [ | ||
| ...mockSlashCommands, | ||
| { | ||
| command: '/newcommand', | ||
| description: 'New command', | ||
| params: 'param1 param2', | ||
| clientOnly: false, | ||
| }, | ||
| ], | ||
| total: mockSlashCommands.length + 1, | ||
| }); | ||
|
|
||
| streamRef.controller?.emit('apps', [['command/added', ['/newcommand']]]); | ||
|
|
||
| await waitFor(() => { | ||
| expect(slashCommands.commands['/newcommand']).toBeDefined(); | ||
| }); | ||
|
|
||
| expect(slashCommands.commands['/test']).toBeDefined(); | ||
| expect(slashCommands.commands['/weather']).toBeDefined(); | ||
| }); | ||
|
|
||
| it('should handle command/updated event by invalidating queries', async () => { | ||
| const streamRef: StreamControllerRef<'apps'> = {}; | ||
|
|
||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot() | ||
| .withJohnDoe() | ||
| .withStream('apps', streamRef) | ||
| .withEndpoint('GET', '/v1/commands.list', mockGetSlashCommands) | ||
| .build(), | ||
| }); | ||
|
|
||
| expect(streamRef.controller).toBeDefined(); | ||
|
|
||
| await waitFor(() => { | ||
| expect(Object.keys(slashCommands.commands)).toHaveLength(mockSlashCommands.length); | ||
| }); | ||
|
|
||
| streamRef.controller?.emit('apps', [['command/updated', ['/test']]]); | ||
|
|
||
| expect(slashCommands.commands['/test']).toBeUndefined(); | ||
| expect(slashCommands.commands['/weather']).toBeDefined(); | ||
| }); | ||
|
|
||
| it('should ignore command/disabled event', async () => { | ||
| const streamRef: StreamControllerRef<'apps'> = {}; | ||
|
|
||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot() | ||
| .withJohnDoe() | ||
| .withStream('apps', streamRef) | ||
| .withEndpoint('GET', '/v1/commands.list', mockGetSlashCommands) | ||
| .build(), | ||
| }); | ||
|
|
||
| expect(streamRef.controller).toBeDefined(); | ||
|
|
||
| await waitFor(() => { | ||
| expect(Object.keys(slashCommands.commands)).toHaveLength(mockSlashCommands.length); | ||
| }); | ||
|
|
||
| streamRef.controller?.emit('apps', [['command/disabled', ['/test']]]); | ||
|
|
||
| expect(slashCommands.commands['/test']).toBeDefined(); | ||
| expect(slashCommands.commands['/weather']).toBeDefined(); | ||
| }); | ||
|
|
||
| it('should not set up stream listener when user ID is not available', () => { | ||
| const streamRef: StreamControllerRef<'apps'> = {}; | ||
|
|
||
| renderHook(() => useAppSlashCommands(), { | ||
| wrapper: mockAppRoot().withStream('apps', streamRef).build(), | ||
| }); | ||
|
|
||
| expect(streamRef.controller).toBeDefined(); | ||
| expect(streamRef.controller?.has('apps')).toBe(false); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/meteor/client/providers/CustomSoundProvider/lib/formatVolume.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import { formatVolume } from './formatVolume'; | ||
|
|
||
| describe('formatVolume', () => { | ||
| it('returns 1 if volume is 100', () => { | ||
| expect(formatVolume(100)).toBe(1); | ||
| }); | ||
|
|
||
| it('returns 1 if volume is 200', () => { | ||
| expect(formatVolume(200)).toBe(1); | ||
| }); | ||
|
|
||
| it('returns 0.5 if volume is 50', () => { | ||
| expect(formatVolume(50)).toBe(0.5); | ||
| }); | ||
|
|
||
| it('returns 0 if volume is -10', () => { | ||
| expect(formatVolume(-10)).toBe(0); | ||
| }); | ||
| }); |
4 changes: 4 additions & 0 deletions
4
apps/meteor/client/providers/CustomSoundProvider/lib/formatVolume.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export const formatVolume = (volume: number) => { | ||
| const clamped = Math.max(0, Math.min(volume, 100)); | ||
| return Number((clamped / 100).toPrecision(2)); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
apps/meteor/client/providers/CustomSoundProvider/lib/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export * from './helpers'; | ||
| export * from './formatVolume'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Good change: derive userId from the authenticated user
Setting
this.userId = this.user?._idprevents header spoofing from leaking into permission checks. LGTM.Run to spot any lingering server code that still trusts
x-user-iddirectly:As a follow-up, consider eliminating
x-user-iddependency during authentication entirely (derive the user solely from the token). Example refactor forauthenticatedRoute:🏁 Script executed:
Length of output: 49525
Do not trust X-User-Id headers — remove/replace remaining server-side usages
Good change to derive this.userId from the authenticated user (prevents header spoofing). However the repo still contains server-side code that reads/trusts X-User-Id; these must be refactored to derive the user from the token (token-only lookup) before merging. Representative locations to fix:
Action: implement token-only authenticatedRoute (or equivalent) and remove header-based authorization/readers, update middleware/helpers/CORS/docs and tests. Block merge until server-side reliance on client-supplied X-User-Id is removed or explicitly validated.
🤖 Prompt for AI Agents