Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

propate no-match found nil file after find* channel based queries #537

Merged
merged 1 commit into from
Dec 28, 2015

Conversation

odeke-em
Copy link
Owner

Fixes #536.
Updates #528.

It is an offset of PR #528, caused by the new pattern remote.FindByPathM -- multiple which returns a channel. Originally a call

         files, err := req.Do()

        if err != nil {
                if err.Error() == ErrGoogleApiInvalidQueryHardCoded.Error() { // Send the user back the query information
                        err = fmt.Errorf("err: %v query: `%s`", err, expr)
                }
                return nil, err
        }

        if files == nil || len(files.Items) < 1 {
                return nil, ErrPathNotExists
        }

        first := files.Items[0]
        if len(p) == 1 {
                return NewRemoteFile(first), nil
        }
        return r.findByPathRecvRaw(first.Id, p[1:], trashed)

The original pattern guaranteed the reporting of unmatched files

and yet now

for rem := range remotesChan {
   ....
}

// Will never be run if the file didn't exist upstream.
yet at no point was a lack of the first match ever propagated back with the empty file

@odeke-em odeke-em merged commit a4c784b into master Dec 28, 2015
@odeke-em odeke-em deleted the fix-remote-chanify branch February 4, 2016 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant