tfsaggregator / tfsaggregator-webhooks

WARNING: the team is no more maintaing this version. See aggreggator-cli instead.
https://github.com/tfsaggregator/aggregator-cli
19 stars 22 forks source link

ProcessEvent for an event of type workitem.deleted causes Exception #23

Closed thom-bringme closed 5 years ago

thom-bringme commented 6 years ago

Aggregator.Core.EventProcessor class crashes in the ProcessEvent method IWorkItem workItem = this.store.GetWorkItem(notification.WorkItemId) when processing an event of type workitem.deleted with the following exception:

Error       [Critical]    00.182 12bff950-6070-4a18-922f-a3f200a305b0 Exception encountered processing notification: TF26198: The work item does not exist, or you do not have permission to access it. 
Stack Trace:   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.LoadWorkItemFromRowSetInternal(Int32 rev, Nullable`1 asof, IWorkItemRowSets witem)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem..ctor(WorkItemStore store, Int32 id)
   at Aggregator.Core.Facade.WorkItemRepository.GetWorkItem(Int32 workItemId)
   at Aggregator.Core.EventProcessor.ProcessEvent(IRequestContext requestContext, INotification notification)
   at Aggregator.WebHooks.Controllers.WorkItemController.Post(JObject payload)
jessehouwing commented 6 years ago

We have a specific filter option for your rule whether you want to trigger on deleted. There is nothing we can really do to catch or handle this exception when it occurs.

On Tue, 20 Mar 2018, 16:28 thom, notifications@github.com wrote:

Aggregator.Core.EventProcessor class crashes in the ProcessEvent method IWorkItem workItem = this.store.GetWorkItem(notification.WorkItemId) when processing an event of type workitem.deleted with the following exception:

Error [Critical] 00.182 12bff950-6070-4a18-922f-a3f200a305b0 Exception encountered processing notification: TF26198: The work item does not exist, or you do not have permission to access it. Stack Trace: at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem.LoadWorkItemFromRowSetInternal(Int32 rev, Nullable`1 asof, IWorkItemRowSets witem) at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItem..ctor(WorkItemStore store, Int32 id) at Aggregator.Core.Facade.WorkItemRepository.GetWorkItem(Int32 workItemId) at Aggregator.Core.EventProcessor.ProcessEvent(IRequestContext requestContext, INotification notification) at Aggregator.WebHooks.Controllers.WorkItemController.Post(JObject payload)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tfsaggregator/tfsaggregator-webhooks/issues/23, or mute the thread https://github.com/notifications/unsubscribe-auth/AD-uS-gig0KFmjCNGCUQ8BELhMQC1s_Xks5tgSAQgaJpZM4SyHUj .

thom-bringme commented 6 years ago

I guess you mean the attribute on the "rule" element in the policies file, like this: changes="New,Change"? If that is what you mean, then I believe there is still an issue/bug, because even when applying the filter to a rule, the EventProcessor will still throw the exception (as this is done before the rules are processed) whenever an event of workitem.deleted is triggered. This caused the service hook in VSTS to be automatically disabled (because the webhook failed processing the event).