Handle all event types correctly #2

Closed
opened 2025-10-31 17:03:27 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @pd4d10 on GitHub (Feb 12, 2019).

News screen shows all events received by current logged in user. Currently only a small part of types are correctly handled, code here:
d152750afb/lib/widgets/event_item.dart (L255-L261)

All event types list here:
https://developer.github.com/v3/activity/events/types/#event-types--payloads

TODOs:

  • CheckRunEvent
  • CheckSuiteEvent
  • CommitCommentEvent
  • ContentReferenceEvent
  • CreateEvent
  • DeleteEvent by @shreyas1599
  • DeployKeyEvent
  • DeploymentEvent
  • DeploymentStatusEvent
  • DownloadEvent
  • FollowEvent
  • ForkEvent
  • ForkApplyEvent
  • GitHubAppAuthorizationEvent
  • GistEvent
  • GollumEvent
  • InstallationEvent
  • InstallationRepositoriesEvent
  • IssueCommentEvent
  • IssuesEvent
  • LabelEvent
  • MarketplacePurchaseEvent by @shreyas1599
  • MemberEvent by @shreyas1599
  • MembershipEvent
  • MetaEvent
  • MilestoneEvent
  • OrganizationEvent
  • OrgBlockEvent
  • PackageEvent
  • PageBuildEvent
  • ProjectCardEvent
  • ProjectColumnEvent
  • ProjectEvent
  • PublicEvent by @shreyas1599
  • PullRequestEvent
  • PullRequestReviewEvent
  • PullRequestReviewCommentEvent
  • PushEvent
  • ReleaseEvent
  • RepositoryDispatchEvent
  • RepositoryEvent
  • RepositoryImportEvent
  • RepositoryVulnerabilityAlertEvent
  • SecurityAdvisoryEvent
  • SponsorshipEvent
  • StarEvent
  • StatusEvent
  • TeamEvent
  • TeamAddEvent
  • WatchEvent
Originally created by @pd4d10 on GitHub (Feb 12, 2019). News screen shows all events received by current logged in user. Currently only a small part of types are correctly handled, code here: https://github.com/pd4d10/git-touch/blob/d152750afb5f6b31b7f3a26d934ee8be2d1d5d20/lib/widgets/event_item.dart#L255-L261 All event types list here: https://developer.github.com/v3/activity/events/types/#event-types--payloads TODOs: - [ ] CheckRunEvent - [ ] CheckSuiteEvent - [ ] CommitCommentEvent - [ ] ContentReferenceEvent - [x] CreateEvent - [x] DeleteEvent by @shreyas1599 - [ ] DeployKeyEvent - [ ] DeploymentEvent - [ ] DeploymentStatusEvent - [ ] DownloadEvent - [ ] FollowEvent - [x] ForkEvent - [ ] ForkApplyEvent - [ ] GitHubAppAuthorizationEvent - [ ] GistEvent - [ ] GollumEvent - [ ] InstallationEvent - [ ] InstallationRepositoriesEvent - [x] IssueCommentEvent - [x] IssuesEvent - [ ] LabelEvent - [x] MarketplacePurchaseEvent by @shreyas1599 - [x] MemberEvent by @shreyas1599 - [ ] MembershipEvent - [ ] MetaEvent - [ ] MilestoneEvent - [ ] OrganizationEvent - [ ] OrgBlockEvent - [ ] PackageEvent - [ ] PageBuildEvent - [ ] ProjectCardEvent - [ ] ProjectColumnEvent - [ ] ProjectEvent - [x] PublicEvent by @shreyas1599 - [x] PullRequestEvent - [ ] PullRequestReviewEvent - [x] PullRequestReviewCommentEvent - [x] PushEvent - [x] ReleaseEvent - [ ] RepositoryDispatchEvent - [ ] RepositoryEvent - [ ] RepositoryImportEvent - [ ] RepositoryVulnerabilityAlertEvent - [ ] SecurityAdvisoryEvent - [ ] SponsorshipEvent - [ ] StarEvent - [ ] StatusEvent - [ ] TeamEvent - [ ] TeamAddEvent - [x] WatchEvent
GiteaMirror added the help wanted label 2025-10-31 17:03:27 -05:00
Author
Owner

@shreyas1599 commented on GitHub (Feb 9, 2020):

@pd4d10 In the news section, only some of the events are visible. Is there any way to modify this so as to verify whether the code I'm writing for the event handlers works as intended? For example, the FollowEvent does not appear in my News tab.

@shreyas1599 commented on GitHub (Feb 9, 2020): @pd4d10 In the news section, only some of the events are visible. Is there any way to modify this so as to verify whether the code I'm writing for the event handlers works as intended? For example, the `FollowEvent` does not appear in my News tab.
Author
Owner

@pd4d10 commented on GitHub (Feb 9, 2020):

@shreyas1599 Thanks for your contribution!

I've checked the API documentation again:

Events of this type are no longer delivered, but it's possible that they exist in timelines of some users. You cannot create webhooks that listen to these events.

It seems a strategy of GitHub itself. Perhaps we only need to handle the available types.

@pd4d10 commented on GitHub (Feb 9, 2020): @shreyas1599 Thanks for your contribution! I've checked the [API documentation](https://developer.github.com/v3/activity/events/types/#followevent) again: > Events of this type are no longer delivered, but it's possible that they exist in timelines of some users. You cannot create webhooks that listen to these events. It seems a strategy of GitHub itself. Perhaps we only need to handle the available types.
Author
Owner

@shreyas1599 commented on GitHub (Feb 9, 2020):

@pd4d10 Thanks for pointing this out. I'll complete the available types first. We could write for the unavailable types as well. Users for whom these events appear in their news could file an issue if there's an error in what we've written as we cannot test these.

@shreyas1599 commented on GitHub (Feb 9, 2020): @pd4d10 Thanks for pointing this out. I'll complete the available types first. We could write for the unavailable types as well. Users for whom these events appear in their news could file an issue if there's an error in what we've written as we cannot test these.
Author
Owner

@shreyas1599 commented on GitHub (Feb 9, 2020):

@pd4d10 I was trying to fill the LabelEvent. In order to get the name of the label I tried adding a JsonSerializableGithubEventLabel class and extracting the label name from that. It throws an error. Am I approaching this correctly? Also, should I regenerate the github.g.dart file after running using flutter packages pub run? I tried that as well. I'm new to this, any help is appreciated. Thanks.

@shreyas1599 commented on GitHub (Feb 9, 2020): @pd4d10 I was trying to fill the `LabelEvent`. In order to get the name of the `label` I tried adding a JsonSerializable`GithubEventLabel` class and extracting the label `name` from that. It throws an error. Am I approaching this correctly? Also, should I regenerate the `github.g.dart` file after running using `flutter packages pub run`? I tried that as well. I'm new to this, any help is appreciated. Thanks.
Author
Owner

@pd4d10 commented on GitHub (Feb 9, 2020):

Yeah, the .g.dart file is generated by build_runner. Try this script

@pd4d10 commented on GitHub (Feb 9, 2020): Yeah, the `.g.dart` file is generated by `build_runner`. Try [this script](https://github.com/pd4d10/git-touch/blob/master/dev.sh)
Author
Owner

@shreyas1599 commented on GitHub (Apr 7, 2020):

Sorry for replying so late. I'm working on it now. There a lot of events which are either not visible in timelines or are only used to trigger hooks. Should I include only those which appear in the user's timeline?

@shreyas1599 commented on GitHub (Apr 7, 2020): Sorry for replying so late. I'm working on it now. There a lot of events which are either not visible in timelines or are only used to trigger hooks. Should I include only those which appear in the user's timeline?
Author
Owner

@Meshellegregory commented on GitHub (Apr 7, 2020):

Not understanding why you sent me this. Explain yourself

Sent from Yahoo Mail for iPhone

On Tuesday, April 7, 2020, 11:13, Shreyas Thirumalai notifications@github.com wrote:

Sorry for replying so late. I'm working on it now. There a lot of events which are either not visible in timelines or are only used to trigger hooks. Should I include only those which appear in the user's timeline?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

@Meshellegregory commented on GitHub (Apr 7, 2020): Not understanding why you sent me this. Explain yourself Sent from Yahoo Mail for iPhone On Tuesday, April 7, 2020, 11:13, Shreyas Thirumalai <notifications@github.com> wrote: Sorry for replying so late. I'm working on it now. There a lot of events which are either not visible in timelines or are only used to trigger hooks. Should I include only those which appear in the user's timeline? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Author
Owner

@pd4d10 commented on GitHub (Apr 7, 2020):

Should I include only those which appear in the user's timeline?

@shreyas1599 Yeah, I think so. It seems hard and unnecessary to cover all these events.

@pd4d10 commented on GitHub (Apr 7, 2020): > Should I include only those which appear in the user's timeline? @shreyas1599 Yeah, I think so. It seems hard and unnecessary to cover all these events.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/git-touch#2