Skip to content

Commit

Permalink
Merge pull request rapidpro#502 from nyaruka/no_more_webhook_results
Browse files Browse the repository at this point in the history
No more webhook results
  • Loading branch information
rowanseymour authored Sep 23, 2021
2 parents a4a5cef + aafb537 commit c5e3832
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 171 deletions.
13 changes: 0 additions & 13 deletions core/handlers/webhook_called.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,5 @@ func handleWebhookCalled(ctx context.Context, tx *sqlx.Tx, rp *redis.Pool, oa *m
scene.AppendToEventPreCommitHook(hooks.InsertHTTPLogsHook, httpLog)
}

// TODO drop this once RP UI is switched to using HTTP logs
response := event.Response
if event.Status == flows.CallStatusConnectionError {
response = "connection error"
}
result := models.NewWebhookResult(
oa.OrgID(), scene.ContactID(),
event.URL, event.Request,
event.StatusCode, response,
time.Millisecond*time.Duration(event.ElapsedMS), event.CreatedOn(),
)
scene.AppendToEventPreCommitHook(hooks.InsertWebhookResultHook, result)

return nil
}
20 changes: 0 additions & 20 deletions core/handlers/webhook_called_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,6 @@ func TestWebhookCalled(t *testing.T) {
SQL: "select count(*) from request_logs_httplog where log_type = 'webhook_called' AND flow_id IS NOT NULL AND status_code = 410",
Count: 3,
},
{
SQL: "select count(*) from api_webhookresult where contact_id = $1 AND status_code = 200",
Args: []interface{}{testdata.Cathy.ID},
Count: 1,
},
{
SQL: "select count(*) from api_webhookresult where contact_id = $1 AND status_code = 410",
Args: []interface{}{testdata.Cathy.ID},
Count: 1,
},
{
SQL: "select count(*) from api_webhookresult where contact_id = $1",
Args: []interface{}{testdata.George.ID},
Count: 3,
},
{
SQL: "select count(*) from api_webhookresult where contact_id = $1",
Args: []interface{}{testdata.George.ID},
Count: 3,
},
{
SQL: "select count(*) from api_webhookevent where org_id = $1",
Args: []interface{}{testdata.Org1.ID},
Expand Down
34 changes: 0 additions & 34 deletions core/hooks/insert_webhook_result.go

This file was deleted.

63 changes: 0 additions & 63 deletions core/models/webhook_results.go

This file was deleted.

41 changes: 0 additions & 41 deletions core/models/webhook_results_test.go

This file was deleted.

0 comments on commit c5e3832

Please sign in to comment.