Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

feat: select first record when no selector function #51

Merged

Conversation

vasco-santos
Copy link
Member

Select first record when no selector function exists for it. Currently, it throws an handled exception and go-ipfs allows other types of keys.

@vasco-santos vasco-santos added the status/blocked Unable to be worked further until needs are met label Nov 8, 2018
@ghost ghost assigned vasco-santos Nov 8, 2018
@ghost ghost added the status/in-progress In progress label Nov 8, 2018
@vasco-santos vasco-santos force-pushed the feat/select-first-record-when-no-selector-function branch from 8e28554 to 29bbf7e Compare November 8, 2018 13:25
@vasco-santos vasco-santos removed the status/blocked Unable to be worked further until needs are met label Nov 8, 2018
src/private.js Outdated
} catch (err) {
// Assume the first record if no selector available
if (err.code !== 'ERR_NO_SELECTOR_FUNCTION_FOR_RECORD_KEY') {
return callback(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vasco-santos maybe we should add another error test to check this callback behavior. It won't matter now, but if we start doing any checking in the waterfall callback this might fail. callback should be cb so the rest of waterfall executes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, it is better to have that test now than have tests failing later. Will add it now.

src/private.js Outdated Show resolved Hide resolved
Co-Authored-By: vasco-santos <vasco.santos@ua.pt>
@vasco-santos vasco-santos merged commit 683a903 into master Nov 9, 2018
@ghost ghost removed the status/in-progress In progress label Nov 9, 2018
@vasco-santos vasco-santos deleted the feat/select-first-record-when-no-selector-function branch November 9, 2018 09:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants