Skip to content

Commit

Permalink
fix(p2p dataset info): return not found if dataset doesn't populate
Browse files Browse the repository at this point in the history
  • Loading branch information
b5 committed Dec 18, 2018
1 parent 57de1ac commit b55af2a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ update-qri-deps: require-gopath
cd $$GOPATH/src/github.com/qri-io/jsonschema && git checkout master && git pull
cd $$GOPATH/src/github.com/qri-io/startf && git checkout master && git pull
cd $$GOPATH/src/github.com/qri-io/starlib && git checkout master && git pull
cd $$GOPATH/src/github.com/qri-io/dag && git checkout master && git pull
cd $$GOPATH/src/github.com/qri-io/qri

install-deps:
Expand Down
2 changes: 1 addition & 1 deletion lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var log = golog.Logger("lib")

// VersionNumber is the current version qri
const VersionNumber = "0.6.1"
const VersionNumber = "0.6.2-dev"

// Requests defines a set of library methods
type Requests interface {
Expand Down
7 changes: 5 additions & 2 deletions p2p/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func (n *QriNode) RequestDataset(ref *repo.DatasetRef) (err error) {
}

for _, pid := range pids {

if err := n.SendMessage(req, replies, pid); err != nil {
log.Debugf("%s err: %s", pid, err.Error())
continue
Expand All @@ -60,13 +59,17 @@ func (n *QriNode) RequestDataset(ref *repo.DatasetRef) (err error) {
res := <-replies
dsr := repo.DatasetRef{}
if err := json.Unmarshal(res.Body, &dsr); err == nil {
if dsr.Dataset != nil {
if dsr.Path != "" && dsr.Dataset != nil {
*ref = dsr
break
}
}
}

if ref.Path == "" {
return repo.ErrNotFound
}

return nil
}

Expand Down
2 changes: 1 addition & 1 deletion p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
// QriProtocolID is the top level Protocol Identifier
QriProtocolID = protocol.ID("/qri")
// QriServiceTag tags the type & version of the qri service
QriServiceTag = "qri/0.6.1"
QriServiceTag = "qri/0.6.2-dev"
// default value to give qri peer connections in connmanager, one hunnit
qriSupportValue = 100
// qriSupportKey is the key we store the flag for qri support under in Peerstores and in ConnManager()
Expand Down

0 comments on commit b55af2a

Please sign in to comment.