Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show "open" notifications #47

Closed
ajdubovoy opened this issue May 15, 2023 · 6 comments
Closed

Show "open" notifications #47

ajdubovoy opened this issue May 15, 2023 · 6 comments

Comments

@ajdubovoy
Copy link

I'm so appreciative this exists!

As with probably other Github users, I don't really organize my notifications by whether they're unread or not. If I'm done with a notification, I mark it as "done".

As far as I can there's no way in this extension to search for "is:open" notifications. It would be awesome to have:

  1. A way to show "is:open"
  2. A way to show "is:done"
  3. A way to mark a notification as open/done

Thanks so much

@LangLangBart
Copy link
Collaborator

LangLangBart commented May 16, 2023

A way to show "is:open"

  • This could be done by implementing a filter that checks if the notification is a PR/issue and then checks if it is still open.
  • The downside
    • notifications retrieved from Github do not contain the information about the status of a PR/issue, you would have to make an additional call for each notification, which would cost time
    • I would love to have color coded notifications
      • green: open
      • red: closed
      • purple: merged
    • Image example from another extension

A way to show "is:done"
A way to mark a notification as open/done


Conclusion

  • Implementing your ideas depends more on GitHub's API.
    • Filtering notifications for issues/PR and checking if they are still open is worth a try, leaving the ticket open for now.
    • it could be added as an additional flag, allowing the user to decide if they prefer speed or more details

@ajdubovoy
Copy link
Author

Thanks so much for the considered response! With the is:open filtering I meant that the notification has not been marked done (not that the associated issue or pr is still open, if applicable).

It's wild that they don't provide access to this in the api but do to lots of other details about notifications.

Anyway, the color coding is still a lovely idea and I so appreciate your work on this

@LangLangBart
Copy link
Collaborator

LangLangBart commented Jun 18, 2023

When interacting with the GitHub WebUI, one can see the API calls being made from the Inspect page on the Querio tab (ref: querio.app). The call to mark notifications as Done is possible, but it does require an additional authenticity_token.


I'm closing the ticket for now, as GitHub does not readily allow the required API calls and no one knows when these undocumented API calls will be made available to the public without using an authenticity_token. Also, generating these authenticity_token doesn't seem to be possible, I couldn't find a way to generate them.


as for the other idea:

Filtering notifications for issues/PR and checking if they are still open is worth a try, leaving the ticket open for now.

I tested it, but I quickly got rate limitations when I made many calls with in short succession to check the state of each issue/pr. A GraphQL API for GitHub notifications would be great.

@rmacklin
Copy link

rmacklin commented Mar 2, 2024

Re:

A way to mark a notification as open/done

  • GitHub does not provide this functionality through its API

Is that not what this is:
https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done
?

@LangLangBart
Copy link
Collaborator

LangLangBart commented Mar 3, 2024

Re:

A way to mark a notification as open/done

  • GitHub does not provide this functionality through its API

Is that not what this is: https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#mark-a-thread-as-done ?

This appears to be a recent addition to the REST API. According to the Wayback machine, the
feature to Mark a thread as done was introduced somewhere between June 10, 20231 and February
5, 20242.

Did you discover the changelog for such updates for the REST API? Although there is a readily
accessible list of updates for the new additions to the GraphQLAPI3, I was under the impression
that no such resource existed for the REST API.


I am considering adding a hotkey to mark notifications as DONE, which would equivalent to marking
a notification in your notification inbox on GitHub as DONE. However, the challenge lies in the
fact that the Terminal would continue to display the same list, as the data does not reflect whether
a notification is DONE or not.

For instance, the notification I received from your comment carries the following information. Even
after marking it as DONE, the returned data remains unchanged. Therefore, pressing the hotkey
wouldn't convey any noticeable changes to the Terminal user. They would only become aware of the
change upon logging into their GitHub account and checking their inbox.

{
"id": "6463980195",
"unread": false,
"reason": "state_change",
"updated_at": "2024-03-02T23:54:38Z",
"last_read_at": null,
"subject": {
	"title": "Show \"open\" notifications",
	"url": "https://api.github.com/repos/meiji163/gh-notify/issues/47",
	"latest_comment_url": "https://api.github.com/repos/meiji163/gh-notify/issues/comments/1974945563",
	"type": "Issue"
},
...

I would prefer to wait until Github introduces a new field for conveying the information, with a
done: true/false status.

Footnotes

  1. https://web.archive.org/web/20230610191811/https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28

  2. https://web.archive.org/web/20240205034519/https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28

  3. GraphQL API Changelog - GitHub Docs

@rmacklin
Copy link

rmacklin commented Mar 3, 2024

Thanks for the detailed reply. Yeah, I see your point about not wanting to implement this if we can't distinguish the "done" items. It's quite frustrating that there's no property in the notification's JSON indicating that it was marked done (or saved for that matter) even after adding the "mark as done" API. Not sure why the API doesn't let us pass query=is:done like the web app does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants