From 4b41bfb4848b5a01f7069bf823b9111523a2c445 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 8 Aug 2016 16:22:25 +0100 Subject: [PATCH] Add TODO for order of operations --- src/github.com/matrix-org/go-neb/services/github/github.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/github.com/matrix-org/go-neb/services/github/github.go b/src/github.com/matrix-org/go-neb/services/github/github.go index 22cdbe6..b61ea91 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github.go +++ b/src/github.com/matrix-org/go-neb/services/github/github.go @@ -201,6 +201,12 @@ func (s *githubService) PostRegister(oldService types.Service) { return } + // TODO: We should be adding webhooks in Register() then removing old hooks in PostRegister() + // + // By doing both operations in PostRegister(), if some of the requests fail we can end up in + // an inconsistent state. It is a lot simpler and easy to reason about this way though, so + // for now it will do. + // remove any existing webhooks this service created on the user's behalf modifyWebhooks(old, cli, true)