Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/blockchain/ethereum/ethereum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func TestInitAllExistingStreams(t *testing.T) {
httpmock.NewJsonResponderOrPanic(200, []eventStream{{ID: "es12345", WebSocket: eventStreamWebsocket{Topic: "topic1"}}}))
httpmock.RegisterResponder("GET", "http://localhost:12345/subscriptions",
httpmock.NewJsonResponderOrPanic(200, []subscription{
{ID: "sub12345", Name: "BatchPin_30783132333435e3" /* this is the subname for our combo of instance path and BatchPin */},
{ID: "sub12345", Stream: "es12345", Name: "BatchPin_30783132333435e3" /* this is the subname for our combo of instance path and BatchPin */},
}))
httpmock.RegisterResponder("PATCH", "http://localhost:12345/eventstreams/es12345",
httpmock.NewJsonResponderOrPanic(200, &eventStream{ID: "es12345", WebSocket: eventStreamWebsocket{Topic: "topic1"}}))
Expand Down
4 changes: 2 additions & 2 deletions internal/blockchain/ethereum/eventstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ func (s *streamManager) ensureSubscription(ctx context.Context, instancePath, st
subName := fmt.Sprintf("%s_%s", abi.Name, instanceUniqueHash)

for _, s := range existingSubs {
if s.Name == subName ||
if s.Stream == stream && (s.Name == subName ||
/* Check for the plain name we used to use originally, before adding uniqueness qualifier.
If one of these very early environments needed a new subscription, the existing one would need to
be deleted manually. */
s.Name == abi.Name {
s.Name == abi.Name) {
sub = s
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/blockchain/fabric/eventstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (s *streamManager) ensureSubscription(ctx context.Context, location *Locati

subName := event
for _, s := range existingSubs {
if s.Name == subName {
if s.Stream == stream && s.Name == subName {
sub = s
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/blockchain/fabric/fabric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func TestInitAllExistingStreams(t *testing.T) {
httpmock.NewJsonResponderOrPanic(200, []eventStream{{ID: "es12345", WebSocket: eventStreamWebsocket{Topic: "topic1"}}}))
httpmock.RegisterResponder("GET", "http://localhost:12345/subscriptions",
httpmock.NewJsonResponderOrPanic(200, []subscription{
{ID: "sub12345", Name: "BatchPin"},
{ID: "sub12345", Stream: "es12345", Name: "BatchPin"},
}))

resetConf()
Expand Down