element-hq / element-hq/element-web

Message Search setting description is broken

Open
#32,080 1 comment 2 reactions 0 assignees View on GitHub
A-Electron A-Search A-Seshat O-Occasional S-Minor T-Defect
Dominant language
TypeScript
Stars
13.5k
Forks
2.8k
PR merge metrics
PR metrics pending

Description

### Steps to reproduce

Open:
All settings -> Security and Privacy -> Message Search -> Manage

There's a label saying:
`How fast should messages be downloaded`
The input field shows a default value of `3000`.

PROBLEM: This description provides no information what that setting is about.
Is `How fast should messages be downloaded` a question?
If yes, I'd answer: as fast as possible
So should I enter `as fast as possible` into the text field? Probably not.
There's not even a unit, telling if `3000` is maybe something like `seconds`, `minutes` or `lightyears`.

### Expected outcome

**A proper description of the setting.**

 

---

 

I've tried to find the answer searching through the source...

I found the German translation of the `How fast should messages be downloaded` string:
https://github.com/element-hq/matrix-react-sdk/blob/c24661f660ed25bfff94697c808a3f9679658517/src/i18n/strings/de_DE.json#L2652
It points to the `message_search_sleep_time` identifier, which points here:

https://github.com/element-hq/matrix-react-sdk/blob/c24661f660ed25bfff94697c808a3f9679658517/src/async-components/views/dialogs/eventindex/ManageEventIndexDialog.tsx#L173
```
label={_t("settings|security|message_search_sleep_time")}
type="number"
value={this.state.crawlerSleepTime.toString()}
onChange={this.onCrawlerSleepTimeChange}
```

https://github.com/element-hq/matrix-react-sdk/blob/c24661f660ed25bfff94697c808a3f9679658517/src/settings/Settings.tsx#L1005
```
"crawlerSleepTime": {
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
displayName: _td("settings|security|message_search_sleep_time"),
default: 3000,
},
```

 

`crawlerSleepTime` then points here:
https://github.com/element-hq/matrix-react-sdk/blob/c24661f660ed25bfff94697c808a3f9679658517/src/indexing/EventIndex.ts#L429
```
// Don't let the user configure a lower sleep time than 100 ms.
sleepTime = Math.max(sleepTime, 100);
```
Good to know! The unit is milliseconds.

By the way, a smaller improvement:
Limit the setting itself to `100` instead of maxing the read out value. So the user knows it sees that it's set to >= 100.

I'm not sure what the rest of the code does.
Do I assume correctly that this is about the maximum time the search will work. And after that time it aborts the search?

Another additional proposal:
The Search-UI should inform the user when it stopped searching. And instead of a global setting the Search-UI could provide a "continue search" button, which continues the search for another `3000` milliseconds.

### Operating system

Debian-12 GNU/Linux

### Application version

1.11.77

### How did you install the app?

https://flathub.org/apps/im.riot.Riot

### Homeserver

matrix.org

### Will you send logs?

No

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.