fix(notifications): clear dismissed approval attention
This commit is contained in:
1 parent
819d3661e1
commit
fabf5e0b78
2 files changed
+8
-3
No files matched your search
+7
-3
@@ -7486,6 +7486,10 @@ function _rememberApprovalPending(pending, pendingCount) {
|
||||
if (!pending) return null;
|
||||
const sid = pending._session_id || _promptActiveSessionId();
|
||||
if (!sid) return null;
|
||||
if (pending.approval_id && _isApprovalDismissed(sid, pending.approval_id)) {
|
||||
_clearApprovalPendingForSession(sid);
|
||||
return sid;
|
||||
}
|
||||
const prev = _approvalPendingBySession.get(sid);
|
||||
// A replacement pending entry DISPLACES the previous prompt for this
|
||||
// session: retire the displaced prompt notification-dedupe key so the same
|
||||
@@ -7714,9 +7718,9 @@ function showApprovalCard(pending, pendingCount) {
|
||||
function dismissApprovalCard() {
|
||||
const sid = _approvalSessionId;
|
||||
if (_approvalCurrentId) _markApprovalDismissed(sid, _approvalCurrentId);
|
||||
// Dismissal is local UI state, not authoritative prompt completion. Keep
|
||||
// the pending owner and its notification-dedupe key until the server reports
|
||||
// resolution or a terminal/cancel lifecycle clears it.
|
||||
// Dismissal clears local attention while the server remains authoritative.
|
||||
// A later poll of the same dismissed approval stays suppressed below.
|
||||
_clearApprovalPendingForSession(sid);
|
||||
hideApprovalCard(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -413,6 +413,7 @@ def test_displaced_pending_prompt_key_is_retired_on_replacement():
|
||||
bump_clarify_generation = _extract_fn(MESSAGES_JS, "_bumpClarifyPromptGeneration")
|
||||
script = f"""
|
||||
const _promptNotifySeen = new Map();
|
||||
const _isApprovalDismissed = () => false;
|
||||
const S = {{ session: {{ session_id: "sid-1" }} }};
|
||||
{keyfn}
|
||||
{retire}
|
||||
|
||||
Reference in new issue
Block a user