From cde004504d4981e93c9719b4417035d465315ed8 Mon Sep 17 00:00:00 2001 From: Ian Calvert Date: Tue, 16 Dec 2025 20:39:45 +0000 Subject: [PATCH 1/2] Explicit null for the system card means no card set --- packages/host/app/services/matrix-service.ts | 11 +++++++++-- .../integration/commands/open-workspace-test.gts | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/host/app/services/matrix-service.ts b/packages/host/app/services/matrix-service.ts index bae7f33ddf..0b6795c83d 100644 --- a/packages/host/app/services/matrix-service.ts +++ b/packages/host/app/services/matrix-service.ts @@ -1947,9 +1947,16 @@ export default class MatrixService extends Service { return this._systemCard; } - private async setSystemCard(systemCardId: string | undefined) { + private async setSystemCard(systemCardId: string | undefined | null) { // Set the system card to use - // If there is none, we fall back to the default + // If it is null, we remove any current system card + // If it is undefined, we fall back to the default + if (systemCardId === null) { + // explicit null means no system card + this.store.dropReference(this._systemCard?.id); + this._systemCard = undefined; + return; + } if (!systemCardId) { systemCardId = ENV.defaultSystemCardId; } diff --git a/packages/host/tests/integration/commands/open-workspace-test.gts b/packages/host/tests/integration/commands/open-workspace-test.gts index c02bb153b6..6f97d2cbd1 100644 --- a/packages/host/tests/integration/commands/open-workspace-test.gts +++ b/packages/host/tests/integration/commands/open-workspace-test.gts @@ -21,6 +21,7 @@ module('Integration | commands | open-workspace', function (hooks) { loggedInAs: '@testuser:localhost', activeRealms: [testRealmURL], autostart: true, + systemCardAccountData: { id: null }, }); hooks.beforeEach(async function () { From 357b8172bae34903ea3abb7e4533a81fda02edc0 Mon Sep 17 00:00:00 2001 From: Ian Calvert Date: Tue, 16 Dec 2025 20:45:30 +0000 Subject: [PATCH 2/2] Support nulls in the type --- packages/host/tests/helpers/mock-matrix.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/host/tests/helpers/mock-matrix.ts b/packages/host/tests/helpers/mock-matrix.ts index 1c3cccbd6a..d5c8c332cf 100644 --- a/packages/host/tests/helpers/mock-matrix.ts +++ b/packages/host/tests/helpers/mock-matrix.ts @@ -23,7 +23,7 @@ export interface Config { autostart?: boolean; now?: () => number; directRooms?: string[]; - systemCardAccountData?: { id?: string }; + systemCardAccountData?: { id?: string | null }; } export function setupMockMatrix(