Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/desktop/src/updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function available(): Promise<boolean> {
if (major < 21) {
// If the macOS version is too old for modern Electron support then disable auto update to prevent the app updating and bricking itself.
// The oldest macOS version supported by Chromium/Electron 38 is Monterey (12.x) which started with Darwin 21.0
initialisePromise.then(() => {
await initialisePromise.then(() => {
ipcMain.emit("showToast", {
title: _t("eol|title"),
description: _t("eol|no_more_updates", { brand: getConfig().brand }),
Expand All @@ -158,7 +158,7 @@ async function available(): Promise<boolean> {
} else if (major < 22) {
// If the macOS version is EOL then show a warning message.
// The oldest macOS version still supported by Apple is Ventura (13.x) which started with Darwin 22.0
initialisePromise.then(() => {
await initialisePromise.then(() => {
ipcMain.emit("showToast", {
title: _t("eol|title"),
description: _t("eol|warning", { brand: getConfig().brand }),
Expand Down
6 changes: 3 additions & 3 deletions apps/web/res/decoder-ring/decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ function bundleSubject(baseUrl, bundle) {
const fetcher = new rxjs.BehaviorSubject(Pending.of());
bundleCache.set(bundle, fetcher);

fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => {
res.body.cancel(); /* Bail on the download immediately - it could be big! */
void fetch(new URL(`bundles/${bundle}/bundle.js.map`, baseUrl).toString()).then((res) => {
void res.body.cancel(); /* Bail on the download immediately - it could be big! */
const status = res.ok;
if (status) {
fetcher.next(Success.of());
Expand Down Expand Up @@ -100,7 +100,7 @@ function fetchAsSubject(endpoint) {
const fetcher = new rxjs.BehaviorSubject(Pending.of());
fetchCache.set(endpoint, fetcher);

fetch(endpoint).then((res) => {
void fetch(endpoint).then((res) => {
if (!res.ok) {
fetcher.next(FetchError.of(`Failed to fetch endpoint ${endpoint}: ${res.status} ${res.statusText}`));
return;
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/ContentMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ function loadVideoElement(videoFile: File): Promise<HTMLVideoElement> {

video.src = dataUrl;
video.load();
video.play();
void video.play();
};
reader.onerror = function (e): void {
reject(e);
Expand Down
32 changes: 16 additions & 16 deletions apps/web/src/LegacyCallHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
MatrixClientPeg.safeGet().on(CallEventHandlerEvent.Incoming, this.onCallIncoming);
}

this.checkProtocols(CHECK_PROTOCOLS_ATTEMPTS);
void this.checkProtocols(CHECK_PROTOCOLS_ATTEMPTS);
}

public stop(): void {
Expand Down Expand Up @@ -171,7 +171,7 @@
if (!callId || this.isForcedSilent()) return;
this.silencedCalls.delete(callId);
this.emit(LegacyCallHandlerEvent.SilencedCallsChanged, this.silencedCalls);
this.play(AudioID.Ring);
void this.play(AudioID.Ring);
}

public isCallSilenced(callId?: string): boolean {
Expand Down Expand Up @@ -221,7 +221,7 @@
} else {
logger.log("Failed to check for protocol support: will retry", e);
window.setTimeout(() => {
this.checkProtocols(maxTries - 1);
void this.checkProtocols(maxTries - 1);
}, 10000);
}
}
Expand Down Expand Up @@ -506,14 +506,14 @@
);

if (pushRuleEnabled && tweakSetToRing && !this.isForcedSilent()) {
this.play(AudioID.Ring);
void this.play(AudioID.Ring);
} else {
this.silenceCall(call.callId);
}
break;
}
case CallState.InviteSent: {
this.play(AudioID.Ringback);
void this.play(AudioID.Ringback);
break;
}
case CallState.Ended: {
Expand All @@ -523,7 +523,7 @@
}

if (oldState === CallState.InviteSent && call.hangupParty === CallParty.Remote) {
this.play(AudioID.Busy);
void this.play(AudioID.Busy);

// Don't show a modal when we got rejected/the call was hung up
if (!hangupReason || [CallErrorCode.UserHangup, "user hangup"].includes(hangupReason)) break;
Expand All @@ -550,11 +550,11 @@
});
} else if (oldState !== CallState.Fledgling && oldState !== CallState.Ringing) {
// don't play the end-call sound for calls that never got off the ground
this.play(AudioID.CallEnd);
void this.play(AudioID.CallEnd);
}

if (isNotNull(mappedRoomId)) {
this.logCallStats(call, mappedRoomId);
void this.logCallStats(call, mappedRoomId);
}
break;
}
Expand Down Expand Up @@ -671,8 +671,8 @@
true,
);

finished.then(([allow]) => {
SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow ?? null);
void finished.then(([allow]) => {
void SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow ?? null);
});
}

Expand Down Expand Up @@ -733,9 +733,9 @@
this.setActiveCallRoomId(roomId);

if (type === CallType.Voice) {
call.placeVoiceCall();
void call.placeVoiceCall();

Check failure on line 736 in apps/web/src/LegacyCallHandler.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of the "void" operator.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ9CcY0TWG6ZX0ULwbD0&open=AZ9CcY0TWG6ZX0ULwbD0&pullRequest=34193
} else if (type === "video") {
call.placeVideoCall();
void call.placeVideoCall();
} else {
logger.error("Unknown conf call type: " + type);
}
Expand Down Expand Up @@ -838,7 +838,7 @@
return;
}

call.answer();
void call.answer();
this.setActiveCallRoomId(roomId);
dis.dispatch<ViewRoomPayload>({
action: Action.ViewRoom,
Expand Down Expand Up @@ -886,7 +886,7 @@
if (consultFirst) {
// if we're consulting, we just start by placing a call to the transfer
// target (passing the transferee so the actual transfer can happen later)
this.dialNumber(destination, call);
void this.dialNumber(destination, call);
return;
}

Expand Down Expand Up @@ -914,7 +914,7 @@
return;
}

this.placeCall(dmRoomId, call.type, call);
void this.placeCall(dmRoomId, call.type, call);
dis.dispatch<ViewRoomPayload>({
action: Action.ViewRoom,
room_id: dmRoomId,
Expand Down Expand Up @@ -1004,7 +1004,7 @@
const messaging = WidgetMessagingStore.instance.getMessagingForUid(WidgetUtils.getWidgetUid(w));
if (!messaging?.widgetApi) return; // more "should never happen" words

messaging.widgetApi.transport.send(ElementWidgetActions.HangupCall, {});
void messaging.widgetApi.transport.send(ElementWidgetActions.HangupCall, {});

Check failure on line 1007 in apps/web/src/LegacyCallHandler.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of the "void" operator.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ9CcY0TWG6ZX0ULwbD3&open=AZ9CcY0TWG6ZX0ULwbD3&pullRequest=34193
});
}

Expand Down
14 changes: 7 additions & 7 deletions apps/web/src/Lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
dis.register((payload) => {
if (payload.action === Action.TriggerLogout) {
// noinspection JSIgnoredPromiseFromCall - we don't care if it fails
onLoggedOut();
void onLoggedOut();
} else if (payload.action === Action.OverwriteLogin) {
const typed = <OverwriteLoginPayload>payload;
// Stop the current client before overwriting the login.
Expand Down Expand Up @@ -483,7 +483,7 @@
button: _t("action|try_again"),
});

finished.then(([shouldTryAgain]) => {
void finished.then(([shouldTryAgain]) => {
// if we have a tryAgain callback, call it the primary 'try again' button was clicked in the dialog
if (shouldTryAgain) tryAgain?.();
});
Expand Down Expand Up @@ -968,7 +968,7 @@
}

_isLoggingOut = true;
PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? "");
await PlatformPeg.get()?.destroyPickleKey(client.getSafeUserId(), client.getDeviceId() ?? "");

doLogout(client, oauth ?? null).then(onLoggedOut, (err) => {
// Just throwing an error here is going to be very unhelpful
Expand All @@ -979,7 +979,7 @@
// tokens expire (and if you really think you've been compromised,
// change your password).
logger.warn("Failed to call logout API: token will not be invalidated", err);
onLoggedOut();
void onLoggedOut();
});
}

Expand Down Expand Up @@ -1075,7 +1075,7 @@
// Similarly, don't start sending presence updates until we've started
// the client
if (!SettingsStore.getValue("lowBandwidth")) {
Presence.start();
void Presence.start();
}

// Now that we have a MatrixClientPeg, update the Jitsi info
Expand Down Expand Up @@ -1193,8 +1193,8 @@

if (unsetClient) {
MatrixClientPeg.unset();
EventIndexPeg.unset();
cli.store.destroy();
void EventIndexPeg.unset();
void cli.store.destroy();

Check failure on line 1197 in apps/web/src/Lifecycle.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this use of the "void" operator.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ9CcY2pWG6ZX0ULwbD7&open=AZ9CcY2pWG6ZX0ULwbD7&pullRequest=34193
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/MatrixClientPeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
private onUnexpectedStoreClose = async (): Promise<void> => {
if (!this.matrixClient) return;
this.matrixClient.stopClient(); // stop the client as the database has failed
this.matrixClient.store.destroy();
void this.matrixClient.store.destroy();

if (!this.matrixClient.isGuest()) {
// If the user is not a guest then prompt them to reload rather than doing it for them
Expand Down Expand Up @@ -278,7 +278,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
if (SettingsStore.getValue("feature_simplified_sliding_sync")) {
opts.slidingSync = await SlidingSyncManager.instance.setup(this.matrixClient);
} else {
SlidingSyncManager.instance.checkSupport(this.matrixClient);
void SlidingSyncManager.instance.checkSupport(this.matrixClient);
}

// Connect the matrix client to the dispatcher and setting handlers
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/MediaDeviceHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default class MediaDeviceHandler extends EventEmitter {
}

public setAudioOutput(deviceId: string): void {
SettingsStore.setValue("webrtc_audiooutput", null, SettingLevel.DEVICE, deviceId);
void SettingsStore.setValue("webrtc_audiooutput", null, SettingLevel.DEVICE, deviceId);
this.emit(MediaDeviceHandlerEvent.AudioOutputChanged, deviceId);
}

Expand All @@ -116,7 +116,7 @@ export default class MediaDeviceHandler extends EventEmitter {
* @param {string} deviceId
*/
public async setAudioInput(deviceId: string): Promise<void> {
SettingsStore.setValue("webrtc_audioinput", null, SettingLevel.DEVICE, deviceId);
void SettingsStore.setValue("webrtc_audioinput", null, SettingLevel.DEVICE, deviceId);
return MatrixClientPeg.safeGet().getMediaHandler().setAudioInput(deviceId);
}

Expand All @@ -126,7 +126,7 @@ export default class MediaDeviceHandler extends EventEmitter {
* @param {string} deviceId
*/
public async setVideoInput(deviceId: string): Promise<void> {
SettingsStore.setValue("webrtc_videoinput", null, SettingLevel.DEVICE, deviceId);
void SettingsStore.setValue("webrtc_videoinput", null, SettingLevel.DEVICE, deviceId);
return MatrixClientPeg.safeGet().getMediaHandler().setVideoInput(deviceId);
}

Expand Down Expand Up @@ -203,13 +203,13 @@ export default class MediaDeviceHandler extends EventEmitter {
return SettingsStore.getValue("audioInputMuted");
}
public static set startWithAudioMuted(value: boolean) {
SettingsStore.setValue("audioInputMuted", null, SettingLevel.DEVICE, value);
void SettingsStore.setValue("audioInputMuted", null, SettingLevel.DEVICE, value);
}

public static get startWithVideoMuted(): boolean {
return SettingsStore.getValue("videoInputMuted");
}
public static set startWithVideoMuted(value: boolean) {
SettingsStore.setValue("videoInputMuted", null, SettingLevel.DEVICE, value);
void SettingsStore.setValue("videoInputMuted", null, SettingLevel.DEVICE, value);
}
}
8 changes: 4 additions & 4 deletions apps/web/src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
this.modals = [];
this.staticModal = null;
this.priorityModal = null;
this.reRender();
void this.reRender();
}

/**
Expand Down Expand Up @@ -287,7 +287,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
this.modals = [];
}

this.reRender();
void this.reRender();
this.emitClosed();
},
modal.deferred.promise,
Expand Down Expand Up @@ -353,7 +353,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
this.modals.unshift(modal);
}

this.reRender();
void this.reRender();
this.emitIfChanged(beforeModal);

return {
Expand All @@ -372,7 +372,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa

this.modals.push(modal);

this.reRender();
void this.reRender();
this.emitIfChanged(beforeModal);

return {
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/Notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,12 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
// make sure that we persist the current setting audio_enabled setting
// before changing anything
if (SettingsStore.isLevelSupported(SettingLevel.DEVICE)) {
SettingsStore.setValue("audioNotificationsEnabled", null, SettingLevel.DEVICE, this.isEnabled());
void SettingsStore.setValue("audioNotificationsEnabled", null, SettingLevel.DEVICE, this.isEnabled());
}

if (enable) {
// Attempt to get permission from user
plaf.requestNotificationPermission().then((result) => {
void plaf.requestNotificationPermission().then((result) => {
if (result !== "granted") {
// The permission request was dismissed or denied
// TODO: Support alternative branding in messaging
Expand Down Expand Up @@ -490,7 +490,7 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi

// wait for first non-cached sync to complete
if (![SyncState.Stopped, SyncState.Error].includes(state) && !data?.fromCache) {
createLocalNotificationSettingsIfNeeded(this.sdkContext.client);
void createLocalNotificationSettingsIfNeeded(this.sdkContext.client);
}
};

Expand All @@ -508,7 +508,7 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
if (ev.getSender() === this.sdkContext.client.getUserId()) return;
if (data.timeline.getTimelineSet().threadListType !== null) return; // Ignore events on the thread list generated timelines

this.sdkContext.client.decryptEventIfNeeded(ev);
void this.sdkContext.client.decryptEventIfNeeded(ev);

// If it's an encrypted event and the type is still 'm.room.encrypted',
// it hasn't yet been decrypted, so wait until it is.
Expand Down Expand Up @@ -585,7 +585,7 @@ export default class Notifier extends TypedEventEmitter<keyof EmittedEvents, Emi
}
if (actions.tweaks.sound && this.isAudioEnabled()) {
PlatformPeg.get()?.loudNotification(ev, room);
this.playAudioNotification(ev, room);
void this.playAudioNotification(ev, room);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/PosthogAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ export class PosthogAnalytics {
"pseudonymousAnalyticsOptIn",
null,
(originalSettingName, changedInRoomId, atLevel, newValueAtLevel, newValue) => {
this.updateAnonymityFromSettings(client, !!newValue);
void this.updateAnonymityFromSettings(client, !!newValue);
},
);
}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/Presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Presence {
while (this.unavailableTimer) {
try {
await this.unavailableTimer.finished();
this.setState(SetPresence.Unavailable);
await this.setState(SetPresence.Unavailable);
} catch {
/* aborted, stop got called */
}
Expand All @@ -63,7 +63,7 @@ class Presence {

private onAction = (payload: ActionPayload): void => {
if (payload.action === Action.UserActivity) {
this.setState(SetPresence.Online);
void this.setState(SetPresence.Online);
this.unavailableTimer?.restart();
}
};
Expand Down
Loading
Loading