Skip to content

Commit e6171f2

Browse files
Christine YanCopilot
andcommitted
Preserve best-effort token clear behavior
Keep DeviceIdentityStore.ClearStoredTokens as a best-effort operation by logging unexpected failures from the shared atomic token-clear helper instead of allowing them to escape connection cleanup flows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 13c8dca commit e6171f2

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/OpenClaw.Connection/DeviceIdentityStore.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public void StoreToken(string identityPath, string token, string[]? scopes, stri
3939
/// </summary>
4040
public static void ClearStoredTokens(string identityDir, IOpenClawLogger? logger = null)
4141
{
42-
DeviceIdentity.TryClearAllDeviceTokens(identityDir, logger);
42+
try
43+
{
44+
DeviceIdentity.TryClearAllDeviceTokens(identityDir, logger);
45+
}
46+
catch (Exception ex)
47+
{
48+
logger?.Warn($"[IdentityStore] Failed to clear device tokens: {ex.Message}");
49+
}
4350
}
4451
}

0 commit comments

Comments
 (0)