Coder Social home page Coder Social logo

Comments (10)

Siilwyn avatar Siilwyn commented on June 12, 2024

Update, I actually just received a notification in Sparks from one of my own repos. Maybe it has to do with the repos I'm working with being private? 💭

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 12, 2024

Update, I actually just received a notification in Sparks from one of my own repos. Maybe it has to do with the repos I'm working with being private? 💭

Maybe. The issue seems to be referencing this line:

url: info.url,

Meaning that the _getSubjectInfo function is falling to get an url for some type of notification that you're getting.

In the meantime I need to figure out how to debug your issue. In github what kind of notifications are you getting? Like issues, pull requests, discussions, etc.

from forge-sparks.

Siilwyn avatar Siilwyn commented on June 12, 2024

All of them are pull request related, most are pull request review requests and some pull request comments.

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 12, 2024

Can you sent me by mail ([email protected]) (or here if you don't mind making it public) the output of calling this in your terminal:

curl https://api.github.com/notifications -H "Authorization: token YOUR_TOKEN_HERE"

It should print the raw JSON Forge Sparks is getting.

from forge-sparks.

Siilwyn avatar Siilwyn commented on June 12, 2024

Yes for sure, I've redacted the name just to be on the safe side: (the missing notification is returned from the api call it seems)

[
  {
    "id": "7258350380",
    "unread": true,
    "reason": "author",
    "updated_at": "2023-08-02T17:25:15Z",
    "last_read_at": "2023-08-02T17:05:19Z",
    "subject": {
      "title": "Suddenly stopped receiving new notifications",
      "url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/issues/10",
      "latest_comment_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/issues/comments/1662656052",
      "type": "Issue"
    },
    "repository": {
      "id": 566851011,
      "node_id": "R_kgDOIcl1ww",
      "name": "forge-sparks",
      "full_name": "rafaelmardojai/forge-sparks",
      "private": false,
      "owner": {
        "login": "rafaelmardojai",
        "id": 6210397,
        "node_id": "MDQ6VXNlcjYyMTAzOTc=",
        "avatar_url": "https://avatars.githubusercontent.com/u/6210397?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/rafaelmardojai",
        "html_url": "https://github.com/rafaelmardojai",
        "followers_url": "https://api.github.com/users/rafaelmardojai/followers",
        "following_url": "https://api.github.com/users/rafaelmardojai/following{/other_user}",
        "gists_url": "https://api.github.com/users/rafaelmardojai/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/rafaelmardojai/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/rafaelmardojai/subscriptions",
        "organizations_url": "https://api.github.com/users/rafaelmardojai/orgs",
        "repos_url": "https://api.github.com/users/rafaelmardojai/repos",
        "events_url": "https://api.github.com/users/rafaelmardojai/events{/privacy}",
        "received_events_url": "https://api.github.com/users/rafaelmardojai/received_events",
        "type": "User",
        "site_admin": false
      },
      "html_url": "https://github.com/rafaelmardojai/forge-sparks",
      "description": "Get git forges notifications",
      "fork": false,
      "url": "https://api.github.com/repos/rafaelmardojai/forge-sparks",
      "forks_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/forks",
      "keys_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/teams",
      "hooks_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/hooks",
      "issue_events_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/issues/events{/number}",
      "events_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/events",
      "assignees_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/assignees{/user}",
      "branches_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/branches{/branch}",
      "tags_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/tags",
      "blobs_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/languages",
      "stargazers_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/stargazers",
      "contributors_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/contributors",
      "subscribers_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/subscribers",
      "subscription_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/subscription",
      "commits_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/issues/comments{/number}",
      "contents_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/contents/{+path}",
      "compare_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/merges",
      "archive_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/downloads",
      "issues_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/issues{/number}",
      "pulls_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/labels{/name}",
      "releases_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/releases{/id}",
      "deployments_url": "https://api.github.com/repos/rafaelmardojai/forge-sparks/deployments"
    },
    "url": "https://api.github.com/notifications/threads/7258350380",
    "subscription_url": "https://api.github.com/notifications/threads/7258350380/subscription"
  },
  {
    "id": "7259767060",
    "unread": true,
    "reason": "review_requested",
    "updated_at": "2023-08-02T15:29:51Z",
    "last_read_at": "2023-08-02T15:30:40Z",
    "subject": {
      "title": "Refactor selector",
      "url": "https://api.github.com/repos/redactedOrg/registration-funnel/pulls/351",
      "latest_comment_url": null,
      "type": "PullRequest"
    },
    "repository": {
      "id": 529175093,
      "node_id": "R_redacted",
      "name": "registration-funnel",
      "full_name": "redactedOrg/registration-funnel",
      "private": true,
      "owner": {
        "login": "redactedOrg",
        "id": 97439011,
        "node_id": "O_redacted",
        "avatar_url": "https://avatars.githubusercontent.com/u/97439011?v=4",
        "gravatar_id": "",
        "url": "https://api.github.com/users/redactedOrg",
        "html_url": "https://github.com/redactedOrg",
        "followers_url": "https://api.github.com/users/redactedOrg/followers",
        "following_url": "https://api.github.com/users/redactedOrg/following{/other_user}",
        "gists_url": "https://api.github.com/users/redactedOrg/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/redactedOrg/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/redactedOrg/subscriptions",
        "organizations_url": "https://api.github.com/users/redactedOrg/orgs",
        "repos_url": "https://api.github.com/users/redactedOrg/repos",
        "events_url": "https://api.github.com/users/redactedOrg/events{/privacy}",
        "received_events_url": "https://api.github.com/users/redactedOrg/received_events",
        "type": "Organization",
        "site_admin": false
      },
      "html_url": "https://github.com/redactedOrg/registration-funnel",
      "description": null,
      "fork": false,
      "url": "https://api.github.com/repos/redactedOrg/registration-funnel",
      "forks_url": "https://api.github.com/repos/redactedOrg/registration-funnel/forks",
      "keys_url": "https://api.github.com/repos/redactedOrg/registration-funnel/keys{/key_id}",
      "collaborators_url": "https://api.github.com/repos/redactedOrg/registration-funnel/collaborators{/collaborator}",
      "teams_url": "https://api.github.com/repos/redactedOrg/registration-funnel/teams",
      "hooks_url": "https://api.github.com/repos/redactedOrg/registration-funnel/hooks",
      "issue_events_url": "https://api.github.com/repos/redactedOrg/registration-funnel/issues/events{/number}",
      "events_url": "https://api.github.com/repos/redactedOrg/registration-funnel/events",
      "assignees_url": "https://api.github.com/repos/redactedOrg/registration-funnel/assignees{/user}",
      "branches_url": "https://api.github.com/repos/redactedOrg/registration-funnel/branches{/branch}",
      "tags_url": "https://api.github.com/repos/redactedOrg/registration-funnel/tags",
      "blobs_url": "https://api.github.com/repos/redactedOrg/registration-funnel/git/blobs{/sha}",
      "git_tags_url": "https://api.github.com/repos/redactedOrg/registration-funnel/git/tags{/sha}",
      "git_refs_url": "https://api.github.com/repos/redactedOrg/registration-funnel/git/refs{/sha}",
      "trees_url": "https://api.github.com/repos/redactedOrg/registration-funnel/git/trees{/sha}",
      "statuses_url": "https://api.github.com/repos/redactedOrg/registration-funnel/statuses/{sha}",
      "languages_url": "https://api.github.com/repos/redactedOrg/registration-funnel/languages",
      "stargazers_url": "https://api.github.com/repos/redactedOrg/registration-funnel/stargazers",
      "contributors_url": "https://api.github.com/repos/redactedOrg/registration-funnel/contributors",
      "subscribers_url": "https://api.github.com/repos/redactedOrg/registration-funnel/subscribers",
      "subscription_url": "https://api.github.com/repos/redactedOrg/registration-funnel/subscription",
      "commits_url": "https://api.github.com/repos/redactedOrg/registration-funnel/commits{/sha}",
      "git_commits_url": "https://api.github.com/repos/redactedOrg/registration-funnel/git/commits{/sha}",
      "comments_url": "https://api.github.com/repos/redactedOrg/registration-funnel/comments{/number}",
      "issue_comment_url": "https://api.github.com/repos/redactedOrg/registration-funnel/issues/comments{/number}",
      "contents_url": "https://api.github.com/repos/redactedOrg/registration-funnel/contents/{+path}",
      "compare_url": "https://api.github.com/repos/redactedOrg/registration-funnel/compare/{base}...{head}",
      "merges_url": "https://api.github.com/repos/redactedOrg/registration-funnel/merges",
      "archive_url": "https://api.github.com/repos/redactedOrg/registration-funnel/{archive_format}{/ref}",
      "downloads_url": "https://api.github.com/repos/redactedOrg/registration-funnel/downloads",
      "issues_url": "https://api.github.com/repos/redactedOrg/registration-funnel/issues{/number}",
      "pulls_url": "https://api.github.com/repos/redactedOrg/registration-funnel/pulls{/number}",
      "milestones_url": "https://api.github.com/repos/redactedOrg/registration-funnel/milestones{/number}",
      "notifications_url": "https://api.github.com/repos/redactedOrg/registration-funnel/notifications{?since,all,participating}",
      "labels_url": "https://api.github.com/repos/redactedOrg/registration-funnel/labels{/name}",
      "releases_url": "https://api.github.com/repos/redactedOrg/registration-funnel/releases{/id}",
      "deployments_url": "https://api.github.com/repos/redactedOrg/registration-funnel/deployments"
    },
    "url": "https://api.github.com/notifications/threads/7259767060",
    "subscription_url": "https://api.github.com/notifications/threads/7259767060/subscription"
  }
]

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 12, 2024

So the "redactedOrg" notification is the one failing right?

Now can you show me the response to:

curl https://api.github.com/repos/redactedOrg/registration-funnel/pulls/351 -H "Authorization: token YOUR_TOKEN_HERE"

from forge-sparks.

Siilwyn avatar Siilwyn commented on June 12, 2024

Ah it's returning this:

{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/pulls/pulls#get-a-pull-request"
}

However I figured out if I enable the full repo scope on the access token I do get a response! And the app now shows the notifications! So I guess all that's needed to fix this is document in preferences panel that full repo scope is needed?

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 12, 2024

Right, so the problem is when Forge Sparks is trying to get more info about the subject it is not longer sung the notifications endpoint.

So I guess all that's needed to fix this is document in preferences panel that full repo scope is needed?

Yes, but the app shouldn’t fail so badly in this scenarios, the notification should be processed successfully but with less details.

from forge-sparks.

rafaelmardojai avatar rafaelmardojai commented on June 12, 2024

@Siilwyn pushed a fix to have a fallback url for the notification when we don't have access to the repo. And also documented the need of the full repo scope.

Would you be able to test?

from forge-sparks.

Siilwyn avatar Siilwyn commented on June 12, 2024

Yes LGTM! Cheers 🎉

from forge-sparks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.