Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

feat: async await and upgrades Hapi to v18 #35

Merged
merged 2 commits into from
Jul 19, 2019
Merged

Conversation

achingbrain
Copy link
Member

BREAKING CHANGE: All api functions that took callbacks now return promises

Still uses pull-streams internally because if it ain't broke you shouldn't try to fix it.

BREAKING CHANGE: All functions that took callbacks now return promises
@achingbrain achingbrain changed the title feat: async await feat: async await and upgrades Hapi to v18 Jul 18, 2019
@achingbrain
Copy link
Member Author

Includes the changes from #7

package.json Outdated
"hapi": "^16.6.2",
"inert": "^4.2.1",
"libp2p-crypto": "~0.16.1",
"epimetheus": "achingbrain/node-epimetheus#hapi-18-support",
Copy link
Member Author

Choose a reason for hiding this comment

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

Pending merging of roylines/node-epimetheus#63

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @achingbrain

All in all, it looks good. Left a minor question

@@ -101,17 +101,14 @@ function Protocol (log) {
}

function getIdAndValidate (pub, id, cb) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not doing async await here as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

It didn't appear to be part of the public API and is only invoked in the context of a socket.io-pull-stream handler which is all callbacks.

@achingbrain achingbrain requested a review from mkg20001 July 19, 2019 14:36
Copy link
Member

@mkg20001 mkg20001 left a comment

Choose a reason for hiding this comment

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

Looks good, waiting for merge of upstream module

If this doesn't get merged in a timely manner, should we just use a fork instead?

@achingbrain
Copy link
Member Author

@mkg20001 I don't know if that PR will ever get merged, it looks a bit like that module has been abandoned.

I've published a fork with the Hapi 18 PR as menoetius (keeping with the Greek mythology theme).

I'll remove it from this repo if the PR ever gets merged.

@mkg20001
Copy link
Member

Ok, merging then

@mkg20001 mkg20001 merged commit e43f063 into master Jul 19, 2019
@mkg20001 mkg20001 deleted the feat/async-await branch July 19, 2019 17:44
@mkg20001 mkg20001 mentioned this pull request Jul 19, 2019
3 tasks
@mkg20001
Copy link
Member

screenshot

npm seems to hate me.

Is it because of missing 2fa?

screenshot

@achingbrain
Copy link
Member Author

achingbrain commented Jul 19, 2019

I'm not sure - is it required for the package? Do you have it enabled?

Aegir will prompt you for an OTP automatically if it detects the challenge in the response.

@mkg20001
Copy link
Member

Unsure and no
That's why I'm confused

@achingbrain
Copy link
Member Author

I think you can check if you log in to the npm website: https://docs.npmjs.com/requiring-2fa-for-package-publishing-and-settings-modification

Also, you should enable 2FA 😉

@mkg20001
Copy link
Member

mkg20001 commented Jul 20, 2019

I've enabled 2fa for my account and set it to authorization only.

Same error, no clue why.

Created a tarball using npm (in case any generated files are needed that aren't in the repo)

package.zip

@daviddias Could you try publishing this? (zip includes a tarball created by npm and a signature for that tarball)

Edit: I've contacted support about this, but it's weekend, so I'll have to wait until monday.

@jacobheun
Copy link
Contributor

FYI I am looking into some issues with this. There are internal usages of crypto that were not migrated from callbacks to async/await with the latest version bumps causing crypto handshakes to stall and fail.

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.

4 participants