Skip to content

The agent that grows with you

refactor(desktop): drop unreachable fences in the Linux notification transport

kshitijk4poorf09af639ac89
diff --git a/apps/desktop/electron/notification-linux.ts b/apps/desktop/electron/notification-linux.ts
index b836edf7153..bd2bb75d721 100644
--- a/apps/desktop/electron/notification-linux.ts
+++ b/apps/desktop/electron/notification-linux.ts
@@ -139,7 +139,7 @@ export function createLinuxNotifications() {
abort.abort()
release()
- if (!target || connection !== target.state) {
+ if (!target) {
return
}
const { state, owner, id } = target
@@ -216,7 +216,7 @@ export function createLinuxNotifications() {
callOptions
)
- if (finished || connection !== state || state.generation !== generation) {
+ if (state.generation !== generation) {
throw new Error('Notification owner changed before delivery')
}
@@ -254,15 +254,12 @@ export function createLinuxNotifications() {
return reject(error)
}
- if (
- finished ||
- connection !== state ||
- state.generation !== generation ||
- !Number.isInteger(id) ||
- id <= 0
- ) {
+ if (state.generation !== generation) {
return reject(new Error('Notification owner changed during delivery'))
}
+ if (!Number.isInteger(id) || id <= 0) {
+ return reject(new Error(`Notify returned an invalid id: ${String(id)}`))
+ }
delivered = { state, owner, id }
// Register in the reply callback, before a signal in the same D-Bus
@@ -270,10 +267,6 @@ export function createLinuxNotifications() {
state.live.set(`${owner}:${id}`, {
owner,
receive: (member, value) => {
- if (finished) {
- return
- }
-
if (
member === 'ActionInvoked' &&
typeof value === 'string' &&