appbaseio / appbaseio/go-appbase

SearchStreamToURL() method fails `go test`

Open
#1 0 comments 0 reactions 1 assignee Claimed by @sacheendra View on GitHub
bug
Dominant language
Go
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I am noticing that webhooks do not get registered in appbase when using the `SearchStreamToURL()` method. The same method with the same app works for the JS lib works successfully (i.e. streams to the mockbin URL when the query condition matches).

I also notice that a corresponding document isn't created in the .percolator type for the webhook. This implies a likely bug / formatting issue in the go-appbase lib.

``` go
package main

import "github.com/appbaseio/go-appbase"
import "log"
import "fmt"

func main() {
client, _ := appbase.NewClient("https://scalr.api.appbase.io", "mj8IvN7DY", "c01fd88a-250e-4321-85bf-51574d5141dc", "go-test")
err := client.Ping()
if err != nil {
log.Fatalln(err)
}

fmt.Println("Client created")
testtype := "tweet2"
webhook := appbase.NewWebhook()
webhook.URL = "https://www.mockbin.org/bin/cd6461ab-468f-42f5-865f-4eed22daae95"
webhook.Method = "POST"
webhook.Body = "hellowebhooks"
const query1 string = `{"query":{"match_all":{}}}`
searchStreamToURLResponse, err := client.SearchStreamToURL().Type(testtype).Query(query1).AddWebhook(webhook).Do()
if err != nil {
log.Fatalln(err)
return
}
fmt.Println(searchStreamToURLResponse)

}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.