Unread notifications #32712
-
Inbox shows 1, but not found. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 6 replies
-
Its just a glitch, nothing to worry about. To get rid of it, mark all your notifications as Read. |
Beta Was this translation helpful? Give feedback.
-
I recently had that issue, too, it's a known bug. You can mark the ghost notification as read using the notifications API, you need a token with notifications scope to authorize the request. I used the Python script below, which lists unread notifications before marking them as read and generally has some more output because I'm curious. It expects the token in the import json
import os
import requests
from datetime import datetime, timezone
NOTIFICATIONS = 'https://api.github.com/notifications'
token = os.environ['GH_TOKEN']
s = requests.Session()
s.headers.update({
'Authorization': f'Bearer {token}',
'Accept': 'application/vnd.github+json'})
r = s.get(NOTIFICATIONS)
print(json.dumps(r.json(), indent=2))
now = datetime.now(timezone.utc)
print(now.isoformat(timespec='seconds'))
r = s.put(
NOTIFICATIONS,
json={
'last_read_at': now.isoformat(timespec='seconds'),
'read': True
})
print(r.status_code)
for k, v in r.headers.items():
print(f'{k}: {v}')
print(r.text) |
Beta Was this translation helpful? Give feedback.
-
Sorry for extra notifications in thread, but this is just such a funny bug. |
Beta Was this translation helpful? Give feedback.
I recently had that issue, too, it's a known bug. You can mark the ghost notification as read using the notifications API, you need a token with notifications scope to authorize the request.
I used the Python script below, which lists unread notifications before marking them as read and generally has some more output because I'm curious. It expects the token in the
GH_TOKEN
environment variable. 😸