Fix event parsing in activity plugin#1760
Conversation
| //Made repository public | ||
| case "PublicEvent": { | ||
| return {type: "public", actor, timestamp, repo} | ||
| return {type:customType, actor, timestamp, repo} |
There was a problem hiding this comment.
Can you explain the rationale behind these changes? Seem unrelated to the stated goal of this PR.
There was a problem hiding this comment.
Yeah sure!
The activity plugin is not working because of an error that happens when parsing events of type PushEvent. The issue will occur even if the user is not interested in disaplying push events, because the filtering happens after the parsing
To make the plugin a bit more robust, I've decided to filter the events beforehand, by mapping the type first, then filtering, then parsing the events: that means that in the eventuality that the plugin breaks again for a certain type of events, the user could temporarily disable those to get the stats back running with just a config change, instead of having to wait for a patch.
To avoid having a mismatch I've moved the custom types to a single map
There was a problem hiding this comment.
Btw, I've just updated the issue description and title: I opened this in a rush and was admittedly pretty poor 😅
|
This pull request seems to be inactive and will be automatically closed in a few days if it remains without any activity. |
|
Repo stale, not PR |
This PR brings a couple of fixes to the event parsing in the activity plugin:
commitshave been removed from thePushEventpayload, so this is currently causing the plugin to fail. I've updated the code to get the commit data from the API instead.Closes #1759