diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d9f334b..cedd656a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # go-graphsync changelog +# go-graphsync 0.5.2 + +Minor release resolves bugs in notification system + +### Changelog + +- github.com/ipfs/go-graphsync: + - RegisterNetworkErrorListener should fire when there's an error connecting to the peer (#127) ([ipfs/go-graphsync#127](https://github.com/ipfs/go-graphsync/pull/127)) + - Permit multiple data subscriptions per original topic (#128) ([ipfs/go-graphsync#128](https://github.com/ipfs/go-graphsync/pull/128)) + - release: v0.5.1 (#123) ([ipfs/go-graphsync#123](https://github.com/ipfs/go-graphsync/pull/123)) + +### Contributors + +| Contributor | Commits | Lines ± | Files Changed | +|-------------|---------|---------|---------------| +| dirkmc | 2 | +272/-185 | 10 | +| Alex Cruikshank | 1 | +188/-110 | 12 | +| Hannah Howard | 1 | +23/-6 | 3 | + # go-graphsync 0.5.1 ### Changelog diff --git a/impl/graphsync_test.go b/impl/graphsync_test.go index 0a322e7c..5b97b898 100644 --- a/impl/graphsync_test.go +++ b/impl/graphsync_test.go @@ -1043,7 +1043,6 @@ func TestGraphsyncBlockListeners(t *testing.T) { require.Equal(t, blockChainLength, blocksSent) } - type gsTestData struct { mn mocknet.Mocknet ctx context.Context diff --git a/notifications/data_subscriber.go b/notifications/data_subscriber.go index 1bda61b0..d8772142 100644 --- a/notifications/data_subscriber.go +++ b/notifications/data_subscriber.go @@ -3,8 +3,8 @@ package notifications import "sync" type TopicDataSubscriber struct { - idMapLk sync.RWMutex - data map[Topic][]TopicData + idMapLk sync.RWMutex + data map[Topic][]TopicData Subscriber } @@ -12,8 +12,8 @@ type TopicDataSubscriber struct { // events and topics before passing them on to the given subscriber func NewTopicDataSubscriber(sub Subscriber) *TopicDataSubscriber { return &TopicDataSubscriber{ - Subscriber: sub, - data: make(map[Topic][]TopicData), + Subscriber: sub, + data: make(map[Topic][]TopicData), } } diff --git a/notifications/types.go b/notifications/types.go index 86da1cdd..a6332631 100644 --- a/notifications/types.go +++ b/notifications/types.go @@ -36,7 +36,7 @@ type EventTransform func(Event) Event // Notifee is a topic data subscriber plus a set of data you want to add to any topics subscribed to // (used to call SubscribeWithData to inject data when events for a given topic emit) type Notifee struct { - Data TopicData + Data TopicData Subscriber *TopicDataSubscriber } diff --git a/requestmanager/requestmanager.go b/requestmanager/requestmanager.go index f5844af1..182e530d 100644 --- a/requestmanager/requestmanager.go +++ b/requestmanager/requestmanager.go @@ -6,9 +6,6 @@ import ( "fmt" "sync/atomic" - "github.com/ipfs/go-graphsync/listeners" - "github.com/ipfs/go-graphsync/messagequeue" - blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" logging "github.com/ipfs/go-log" @@ -20,7 +17,9 @@ import ( "github.com/ipfs/go-graphsync/cidset" "github.com/ipfs/go-graphsync/dedupkey" ipldutil "github.com/ipfs/go-graphsync/ipldutil" + "github.com/ipfs/go-graphsync/listeners" gsmsg "github.com/ipfs/go-graphsync/message" + "github.com/ipfs/go-graphsync/messagequeue" "github.com/ipfs/go-graphsync/metadata" "github.com/ipfs/go-graphsync/notifications" "github.com/ipfs/go-graphsync/requestmanager/executor" diff --git a/requestmanager/requestmanager_test.go b/requestmanager/requestmanager_test.go index 715ccc80..205cc991 100644 --- a/requestmanager/requestmanager_test.go +++ b/requestmanager/requestmanager_test.go @@ -7,8 +7,6 @@ import ( "testing" "time" - "github.com/ipfs/go-graphsync/listeners" - blocks "github.com/ipfs/go-block-format" "github.com/ipld/go-ipld-prime" cidlink "github.com/ipld/go-ipld-prime/linking/cid" @@ -18,6 +16,7 @@ import ( "github.com/ipfs/go-graphsync" "github.com/ipfs/go-graphsync/cidset" "github.com/ipfs/go-graphsync/dedupkey" + "github.com/ipfs/go-graphsync/listeners" gsmsg "github.com/ipfs/go-graphsync/message" "github.com/ipfs/go-graphsync/metadata" "github.com/ipfs/go-graphsync/notifications" diff --git a/responsemanager/peerresponsemanager/peerresponsesender.go b/responsemanager/peerresponsemanager/peerresponsesender.go index 797608dd..79a71ce0 100644 --- a/responsemanager/peerresponsemanager/peerresponsesender.go +++ b/responsemanager/peerresponsemanager/peerresponsesender.go @@ -467,7 +467,7 @@ func (prs *peerResponseSender) sendResponseMessages() { continue } notifications.SubscribeWithData(prs.publisher, builder.Topic(), notifications.Notifee{ - Data: builder.BlockSize(), + Data: builder.BlockSize(), Subscriber: prs.allocatorSubscriber, }) responses, blks, err := builder.Build() @@ -476,7 +476,7 @@ func (prs *peerResponseSender) sendResponseMessages() { } prs.peerHandler.SendResponse(prs.p, responses, blks, notifications.Notifee{ - Data: builder.Topic(), + Data: builder.Topic(), Subscriber: prs.subscriber, }) diff --git a/testutil/testnotifications.go b/testutil/testnotifications.go index e71ef47a..80bddee8 100644 --- a/testutil/testnotifications.go +++ b/testutil/testnotifications.go @@ -88,7 +88,7 @@ func (nv *NotifeeVerifier) ExpectClose(ctx context.Context, t *testing.T) { func NewTestNotifee(data notifications.TopicData, bufferSize int) (notifications.Notifee, *NotifeeVerifier) { subscriber := NewTestSubscriber(bufferSize) return notifications.Notifee{ - Data: data, + Data: data, Subscriber: notifications.NewTopicDataSubscriber(subscriber), }, &NotifeeVerifier{ expectedTopic: data,