-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix: Global Search "Jump to message" failing due to incorrect URL generation #37717
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
kodiakhq
merged 15 commits into
develop
from
fix/global-search-jump-to-message-invalid-url
Dec 19, 2025
Merged
Changes from 5 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
57a03f1
fix: invalid URL generation causing Global Search 'Jump to message' t…
abhinavkrin b4ce9a4
added changeset
abhinavkrin cc17fd2
update test
abhinavkrin 071d541
improve test
abhinavkrin 56d7514
updated tests
abhinavkrin bea7016
updated changeset
abhinavkrin 8b668d0
fix: review
dougfabris d618fd2
requested changes
abhinavkrin 255bfdf
test: remove timeout option
dougfabris e09d3c5
test: remove unnecessary setting from fixture
dougfabris c65c1e4
Merge branch 'develop' into fix/global-search-jump-to-message-invalid…
scuciatto bfe9afd
Merge branch 'develop' into fix/global-search-jump-to-message-invalid…
scuciatto 55d0948
Merge branch 'develop' into fix/global-search-jump-to-message-invalid…
kodiakhq[bot] e56d54d
Merge branch 'develop' into fix/global-search-jump-to-message-invalid…
kodiakhq[bot] f633f6d
Merge branch 'develop' into fix/global-search-jump-to-message-invalid…
kodiakhq[bot] 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 | ||
| --- | ||
|
|
||
| Fixed incorrect URL generation in Global Search "Jump to message" feature, resolving navigation issues when jumping to messages across different channels. | ||
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
abhinavkrin marked this conversation as resolved.
Show resolved
Hide resolved
|
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,82 @@ | ||
| import type { IMessage } from '@rocket.chat/core-typings'; | ||
| import { Random } from '@rocket.chat/random'; | ||
|
|
||
| import { Users } from './fixtures/userStates'; | ||
| import { HomeChannel } from './page-objects'; | ||
| import { setSettingValueById } from './utils'; | ||
| import type { BaseTest } from './utils/test'; | ||
| import { expect, test } from './utils/test'; | ||
|
|
||
| test.use({ storageState: Users.admin.state }); | ||
| test.describe.serial('Global Search', () => { | ||
| let targetChannel: { name: string; _id: string }; | ||
| let targetGroup: { name: string; _id: string }; | ||
| let threadMessage: IMessage; | ||
| let poHomeChannel: HomeChannel; | ||
|
|
||
| const fillMessages = async (api: BaseTest['api']) => { | ||
| const { message: parentMessage } = await ( | ||
| await api.post('/chat.postMessage', { roomId: targetChannel._id, text: 'This is main message in channel' }) | ||
| ).json(); | ||
|
|
||
| const { message: childMessage } = await ( | ||
| await api.post('/chat.postMessage', { roomId: targetChannel._id, text: `This is thread message in channel`, tmid: parentMessage._id }) | ||
| ).json(); | ||
| threadMessage = childMessage; | ||
| }; | ||
|
|
||
| test.beforeAll(async ({ api }) => { | ||
| await Promise.all([ | ||
| api | ||
| .post('/channels.create', { name: Random.id() }) | ||
| .then((res) => res.json()) | ||
| .then((data) => { | ||
| targetChannel = data.channel; | ||
| }), | ||
| api | ||
| .post('/groups.create', { | ||
| name: Random.id(), | ||
| extraData: { encrypted: false }, | ||
| }) | ||
| .then((res) => res.json()) | ||
| .then((data) => { | ||
| targetGroup = data.group; | ||
| }), | ||
| setSettingValueById(api, 'Search.Provider', 'defaultProvider'), | ||
| setSettingValueById(api, 'Search.defaultProvider.GlobalSearchEnabled', true), | ||
| ]); | ||
| await fillMessages(api); | ||
| }); | ||
|
|
||
| test.afterAll(({ api }) => | ||
| Promise.all([ | ||
| api.post('/channels.delete', { roomId: targetChannel._id }), | ||
| api.post('/groups.delete', { roomId: targetGroup._id }), | ||
| setSettingValueById(api, 'Search.defaultProvider.GlobalSearchEnabled', false), | ||
| setSettingValueById(api, 'Search.Provider', 'defaultProvider'), | ||
| ]), | ||
| ); | ||
abhinavkrin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| poHomeChannel = new HomeChannel(page); | ||
| await page.goto('/home'); | ||
| }); | ||
|
|
||
| test('opens correct message when jumping from global search in group to channel thread', async ({ page }) => { | ||
| // await poHomeChannel.goto(`/group/${targetGroup.name}`); | ||
| await poHomeChannel.sidenav.openChat(targetGroup.name); | ||
| await poHomeChannel.roomToolbar.btnSearchMessages.click(); | ||
|
|
||
| await poHomeChannel.tabs.searchMessages.search(threadMessage.msg.slice(10), { global: true, timeout: 10000 }); // fill partial text to match search | ||
abhinavkrin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| const message = await poHomeChannel.tabs.searchMessages.getResultItem(threadMessage.msg); | ||
| await expect(message).toBeVisible(); | ||
abhinavkrin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| await message.hover(); | ||
| const jumpToMessageButton = message.getByTitle('Jump to message'); | ||
abhinavkrin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| await expect(jumpToMessageButton).toBeVisible(); | ||
abhinavkrin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| await jumpToMessageButton.click(); | ||
|
|
||
| await expect(page.locator('header').getByRole('button').filter({ hasText: targetChannel.name })).toBeVisible(); // match channel name in room header | ||
| await expect(page.getByText(threadMessage.msg)).toBeVisible(); | ||
| }); | ||
| }); | ||
20 changes: 20 additions & 0 deletions
20
apps/meteor/tests/e2e/page-objects/fragments/home-flextab-searchMessages.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,20 @@ | ||
| import type { Locator, Page } from '@playwright/test'; | ||
|
|
||
| export class HomeFlextabSearchMessages { | ||
| readonly searchTab: Locator; | ||
|
|
||
| constructor(protected page: Page) { | ||
| this.searchTab = this.page.getByRole('dialog', { name: 'Search Messages' }); | ||
| } | ||
|
|
||
| async search(text: string, { global = false, timeout }: { global?: boolean; timeout?: number } = {}) { | ||
| if (global) { | ||
| await this.searchTab.getByText('Global search').click({ timeout }); | ||
| } | ||
| await this.searchTab.getByPlaceholder('Search Messages').fill(text, { timeout }); | ||
| } | ||
|
|
||
| async getResultItem(messageText: string) { | ||
| return this.searchTab.getByRole('listitem', { name: messageText }); | ||
| } | ||
| } |
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
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.
Uh oh!
There was an error while loading. Please reload this page.