Fix ability to send rageshake during session restore failure (#31848)
* Fix ability to send rageshake during session restore failure This fixes the specific edge case but also hardens the codepath to limit the effect of other similar edges popping up Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve coverage Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Improve coverage Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
51f5ec021a
commit
d733ac014c
@@ -893,7 +893,12 @@ export default class SettingsStore {
|
||||
for (const settingKey of (Object.keys(SETTINGS) as SettingKey[]).filter(
|
||||
(s) => SETTINGS[s].shouldExportToRageshake !== false,
|
||||
)) {
|
||||
settingMap[settingKey] = SettingsStore.getValue(settingKey);
|
||||
try {
|
||||
settingMap[settingKey] = SettingsStore.getValue(settingKey);
|
||||
} catch (e) {
|
||||
logger.warn("Failed to read setting", settingKey, e);
|
||||
settingMap[settingKey] = "Failed to read setting!";
|
||||
}
|
||||
}
|
||||
return JSON.stringify(settingMap);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import { type SettingLevel } from "../SettingLevel";
|
||||
// default action on this rule is dont_notify, but it could be something else
|
||||
export function isPushNotifyDisabled(): boolean {
|
||||
// Return the value of the master push rule as a default
|
||||
const masterRule = MatrixClientPeg.safeGet().pushProcessor.getPushRuleById(".m.rule.master");
|
||||
const masterRule = MatrixClientPeg.get()?.pushProcessor.getPushRuleById(".m.rule.master");
|
||||
|
||||
if (!masterRule) {
|
||||
logger.warn("No master push rule! Notifications are disabled for this user.");
|
||||
|
||||
Reference in New Issue
Block a user