Send terminate error messages

This commit is contained in:
Owen
2026-01-16 14:57:54 -08:00
parent a126494c12
commit 9114dd5992
11 changed files with 41 additions and 8 deletions

View File

@@ -10,6 +10,7 @@ import { sendTerminateClient } from "../client/terminate";
import { encodeHexLowerCase } from "@oslojs/encoding";
import { sha256 } from "@oslojs/crypto/sha2";
import { sendOlmSyncMessage } from "./sync";
import { OlmErrorCodes } from "./error";
// Track if the offline checker interval is running
let offlineCheckerInterval: NodeJS.Timeout | null = null;
@@ -64,6 +65,8 @@ export const startOlmOfflineChecker = (): void => {
try {
await sendTerminateClient(
offlineClient.clientId,
OlmErrorCodes.TERMINATED_INACTIVITY,
"Client terminated due to inactivity",
offlineClient.olmId
); // terminate first
// wait a moment to ensure the message is sent