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

return promise if callback not passed to async methods #157

Merged
merged 2 commits into from
Jan 22, 2020

Conversation

jstewmon
Copy link
Contributor

This is based on #155 and #156 . It could use a few more tests, but I wanted to get some feedback before writing any more.

BTW, vows seems dead, and has terrible ergonomics for async tests. Any interest in switching to something else? I'm partial to ava these days, but literally anything would be better than vows. :-)

@stash
Copy link
Collaborator

stash commented May 6, 2019

@jstewmon regarding vows: yeah, that seemed like a good idea at the time. I agree literally anything is better than vows ;)

@stash stash self-assigned this May 6, 2019
@stash stash requested a review from awaterma May 6, 2019 20:37
@jstewmon jstewmon force-pushed the promises branch 2 times, most recently from 58daa88 to 3ab06cf Compare May 7, 2019 14:18
@awaterma awaterma assigned awaterma and unassigned awaterma May 29, 2019
@awaterma awaterma self-assigned this Jul 1, 2019
@awaterma awaterma added the major We expect this work to be a major semver change label Jul 1, 2019
@medelibero-sfdc medelibero-sfdc self-requested a review November 11, 2019 21:18
@medelibero-sfdc
Copy link
Contributor

Hi @jstewmon,

Any chance you could revise the latest in main? Also, we will get this merged but first we want to get #156 merged and then this one.

Thanks,
Mike

@jstewmon
Copy link
Contributor Author

jstewmon commented Nov 13, 2019

@medelibero-sfdc 👋 , I'm working on rebasing #156 now. Let's please make this the last time I have to rebase - #156 has so many line moves that it is very tedious to integrate long runs of changes from master. 🙏

@jstewmon
Copy link
Contributor Author

@medelibero-sfdc unfortunately, #173 precludes a clean path forward here because the callback should always be the last argument...

Also, that PR did not update the interface in the Store base class.

I have addressed those two issues in #156 in a new commit that notes the breaking change.

@awaterma
Copy link
Member

Thank you for your help with this @jstewmon; sorry to ask for so many rebases. We should be good going forward.

@jstewmon
Copy link
Contributor Author

@awaterma it wasn't too much trouble until other PRs started being accepted while #156 lingered... That PR is just especially difficult for merge tools to auto merge, so I have to go through everything by hand and fix up conflicts.

Copy link
Member

@awaterma awaterma left a comment

Choose a reason for hiding this comment

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

I think we'll need to rebase again to pickup the Store changes in the Class P/R. I'll try and take more of a look over this holiday week/weekend.

if (!this.idx[domain]) {
return cb(null,undefined);
"use strict";
const { fromCallback } = require("universalify");
Copy link
Member

Choose a reason for hiding this comment

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

If we move to more modern syntax; won't this effect our dependents? I think if we are targeting older platforms, we may need to talk more about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Destructuring assignment is supported in node 6+.

lib/memstore.js Outdated
Object.keys(domainIndex).forEach(cookiePath => {
if (pathMatch(path, cookiePath)) {
const pathIndex = domainIndex[cookiePath];

Copy link
Member

Choose a reason for hiding this comment

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

Let's drop the whitespace here.

@awaterma awaterma requested review from awaterma and removed request for medelibero-sfdc November 26, 2019 00:09
@jstewmon jstewmon force-pushed the promises branch 2 times, most recently from 61a1126 to e0f7777 Compare November 26, 2019 00:14
@jstewmon
Copy link
Contributor Author

@awaterma thanks for the review. I rebased on master and addressed your feedback.

@jstewmon
Copy link
Contributor Author

jstewmon commented Dec 5, 2019

👋 @awaterma freshly rebased if you have time to take another look 🙏

@medelibero-sfdc medelibero-sfdc self-requested a review December 9, 2019 20:34
@awaterma awaterma added this to the 4.x Release milestone Dec 9, 2019
@awaterma
Copy link
Member

awaterma commented Jan 3, 2020

I think this looks good; I'd like to discuss a bit with the open source term before merging. I'd rather not add an additional dependency; but "universalify" does provide the right solution. It's more of an extra dependency trade off discussion. :) Anyway, we should have good progress on this soon.

Copy link
Member

@awaterma awaterma left a comment

Choose a reason for hiding this comment

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

We've discussed this at length and are ready to pull it in; there a small merge with master that needs to be done before, however. I can do that through the console, or we can wait on @jstewmon to update. I'll wait a day for a reply and if we don't hear back, I'll try merging master into this branch with GitHub; then approve the final p/r.

@awaterma awaterma self-requested a review January 21, 2020 22:09
Copy link
Member

@awaterma awaterma left a comment

Choose a reason for hiding this comment

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

LGTM. Updated with upstream changes now.

@awaterma awaterma merged commit d5d6f79 into salesforce:master Jan 22, 2020
@jstewmon
Copy link
Contributor Author

@awaterma thanks for pushing this over the line! 🙏 🎉

Sorry for not responding over the last week - just been exceptionally busy at work. 😅

@awaterma
Copy link
Member

We're grateful for the help! Thank you for contributing!

@PixnBits PixnBits mentioned this pull request Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:signed major We expect this work to be a major semver change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants