Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 80013a2

Browse files
authored
Merge pull request #5787 from matrix-org/gsouquet-event-indexing-settings
Improve error reporting when EventIndex fails on a supported environment
2 parents 760b11f + 5104d7b commit 80013a2

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

src/components/views/settings/EventIndexPanel.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default class EventIndexPanel extends React.Component {
190190
}
191191
</div>
192192
);
193-
} else {
193+
} else if (!EventIndexPeg.platformHasSupport()) {
194194
eventIndexingSettings = (
195195
<div className='mx_SettingsTab_subsectionText'>
196196
{
@@ -208,6 +208,23 @@ export default class EventIndexPanel extends React.Component {
208208
}
209209
</div>
210210
);
211+
} else {
212+
eventIndexingSettings = (
213+
<div className='mx_SettingsTab_subsectionText'>
214+
<p>
215+
{_t("Message search initilisation failed")}
216+
</p>
217+
{EventIndexPeg.error && (
218+
<details>
219+
<summary>{_t("Advanced")}</summary>
220+
<code>
221+
{EventIndexPeg.error.message}
222+
</code>
223+
</details>
224+
)}
225+
226+
</div>
227+
);
211228
}
212229

213230
return eventIndexingSettings;

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@
10831083
"Securely cache encrypted messages locally for them to appear in search results.": "Securely cache encrypted messages locally for them to appear in search results.",
10841084
"%(brand)s is missing some components required for securely caching encrypted messages locally. If you'd like to experiment with this feature, build a custom %(brand)s Desktop with <nativeLink>search components added</nativeLink>.": "%(brand)s is missing some components required for securely caching encrypted messages locally. If you'd like to experiment with this feature, build a custom %(brand)s Desktop with <nativeLink>search components added</nativeLink>.",
10851085
"%(brand)s can't securely cache encrypted messages locally while running in a web browser. Use <desktopLink>%(brand)s Desktop</desktopLink> for encrypted messages to appear in search results.": "%(brand)s can't securely cache encrypted messages locally while running in a web browser. Use <desktopLink>%(brand)s Desktop</desktopLink> for encrypted messages to appear in search results.",
1086+
"Message search initilisation failed": "Message search initilisation failed",
10861087
"Connecting to integration manager...": "Connecting to integration manager...",
10871088
"Cannot connect to integration manager": "Cannot connect to integration manager",
10881089
"The integration manager is offline or it cannot reach your homeserver.": "The integration manager is offline or it cannot reach your homeserver.",

src/indexing/EventIndexPeg.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class EventIndexPeg {
3131
constructor() {
3232
this.index = null;
3333
this._supportIsInstalled = false;
34+
this.error = null;
3435
}
3536

3637
/**
@@ -96,6 +97,7 @@ class EventIndexPeg {
9697
await index.init();
9798
} catch (e) {
9899
console.log("EventIndex: Error initializing the event index", e);
100+
this.error = e;
99101
return false;
100102
}
101103

0 commit comments

Comments
 (0)