[GH-ISSUE #4] user block status not detectable #3

Closed
opened 2026-02-27 20:04:48 +03:00 by kerem · 3 comments
Owner

Originally created by @catdkl on GitHub (Jun 19, 2025).
Original GitHub issue: https://github.com/misiektoja/github_monitor/issues/4

any way to tell if the user you track blocked you without doing anything? don't see anything in pygithub or the github api spec, seems like all info is always available?

Originally created by @catdkl on GitHub (Jun 19, 2025). Original GitHub issue: https://github.com/misiektoja/github_monitor/issues/4 any way to tell if the user you track blocked you without doing anything? don't see anything in pygithub or the github api spec, seems like all info is always available?
kerem closed this issue 2026-02-27 20:04:49 +03:00
Author
Owner

@misiektoja commented on GitHub (Jun 20, 2025):

Hey! I don't think it's possible. If it were, PyGithub would probably have something for it, but I'll dig a bit deeper when I get the chance. Maybe there's a hidden way lurking around ...

<!-- gh-comment-id:2991250253 --> @misiektoja commented on GitHub (Jun 20, 2025): Hey! I don't think it's possible. If it were, PyGithub would probably have something for it, but I'll dig a bit deeper when I get the chance. Maybe there's a hidden way lurking around ...
Author
Owner

@misiektoja commented on GitHub (Jun 24, 2025):

I have some good news! I did some research yesterday and found that the only way to check if someone blocked you is to try something like following them. But let's be honest, that's not really what you want to do. I noticed something interesting, though. There's a documented viewerCanFollow field in the GraphQL schema. It tells you if viewer is allowed to follow the specific user.

It turns out GitHub only returns false for that field if either the viewer is the same account or you've been blocked. Not sure if it is a GitHub's oversight or just side effect of how GraphQL enforces follow permissions, but check out v2.0 - it gives you the cool feature that automatically detects and notifies you if the token owner is blocked or unblocked by the tracked user!

<!-- gh-comment-id:3001283071 --> @misiektoja commented on GitHub (Jun 24, 2025): I have some good news! I did some research yesterday and found that the only way to check if someone blocked you is to try something like following them. But let's be honest, that's not really what you want to do. I noticed something interesting, though. There's a documented `viewerCanFollow` field in the GraphQL schema. It tells you if viewer is allowed to follow the specific user. It turns out GitHub only returns false for that field if either the viewer is the same account or you've been blocked. Not sure if it is a GitHub's oversight or just side effect of how GraphQL enforces follow permissions, but check out v2.0 - it gives you the cool feature that automatically detects and notifies you if the token owner is blocked or unblocked by the tracked user!
Author
Owner

@catdkl commented on GitHub (Jun 25, 2025):

didn't think this would actually work, figured you were joking, but turns out it does - appreciate the help, awesome work

<!-- gh-comment-id:3006242208 --> @catdkl commented on GitHub (Jun 25, 2025): didn't think this would actually work, figured you were joking, but turns out it does - appreciate the help, awesome work
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/github_monitor#3
No description provided.