Skip to content

notif act/dismiss should mark GitHub threads done upstream #5

Description

@blink-claw-bot

Problem

argus notif act and argus notif dismiss update the local SQLite row, but they do not update the upstream GitHub notification thread. That leaves a split-brain state: Argus says the notification is handled, while GitHub may still show it as unread/inbox/done-state pending depending on the user's notification UI/API view.

Relevant code:

  • cmd_notif_act updates notifications.acted_at and logs activity, then returns.
  • cmd_notif_dismiss sets dismissed = 1 and logs activity, then returns.

Suggested behavior

When a notification is explicitly acted or dismissed, mark the GitHub thread as Done too.

GitHub's REST API distinguishes read vs done:

  • PATCH /notifications/threads/{thread_id} = read
  • DELETE /notifications/threads/{thread_id} = done

Implementation hint

Add a small helper and call it from both cmd_notif_act and cmd_notif_dismiss for the gh backend:

def gh_mark_thread_done(notif_id: str) -> bool:
    result = subprocess.run(
        ["gh", "api", "--method", "DELETE", f"notifications/threads/{notif_id}"],
        capture_output=True,
        text=True,
    )
    if result.returncode != 0:
        print(f"Warning: failed to mark GitHub notification done: {result.stderr}", file=sys.stderr)
        return False
    return True

Do not delete /subscription for normal done handling; unsubscribing can suppress future useful notifications on that thread.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions