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

Make whenNothingPending always async #222

Merged
merged 5 commits into from
Apr 10, 2019

Conversation

gkubisa
Copy link
Contributor

@gkubisa gkubisa commented Jul 12, 2018

@coveralls
Copy link

coveralls commented Jul 12, 2018

Coverage Status

Coverage increased (+0.003%) to 95.906% when pulling fe1b7c0 on Teamwork:fix-whenNothingPending into 5394fa4 on share:master.

Copy link
Contributor

@curran curran 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 to me aside from some duplicated logic!

Also to clarify the motivation for this PR, I'm guessing it's the following statement by @ericyhwang from #204 (comment)

Code should always be async (e.g. process.nextTick) or always be sync, not both.

and

Remove the sync workaround, make a separate PR for making whenNothingPending async consistently.

lib/client/doc.js Show resolved Hide resolved
@gkubisa
Copy link
Contributor Author

gkubisa commented Nov 5, 2018

@ericyhwang , could this PR be merged now?

Copy link
Contributor

@curran curran 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! Thanks for making that change removing the duplicated logic.

There seems to be a meaningful test case removed (see inline comment).

test/client/doc.js Show resolved Hide resolved
Copy link
Contributor

@curran curran 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 to merge! /cc @ericyhwang

test/client/doc.js Show resolved Hide resolved
@curran
Copy link
Contributor

curran commented Apr 9, 2019

@gkubisa This change looks good, but unfortunately now has merge conflicts.

@ericyhwang I think this would be a nice improvement. In fact I just ran into issues around this async behavior today.

@gkubisa
Copy link
Contributor Author

gkubisa commented Apr 9, 2019

This PR has been already open for over 9 months, so I have very little motivation to keep it up to date with the master branch. It's already merged into the Teamwork fork of ShareDB.

@curran
Copy link
Contributor

curran commented Apr 9, 2019

Understood. It's unfortunate that this good work has not gotten the attention it deserves.

@ericyhwang
Copy link
Contributor

Ah, I lost track of this, sorry - my email notification routing for the Share org wasn't properly set up at that point.

I'll do some integration testing on my end, and if that all checks out, we can get it merged tomorrow.

@curran
Copy link
Contributor

curran commented Apr 10, 2019

Potentially this nextTick can be removed

process.nextTick(function() {

Although, it's unrelated because it's on the connection. This could be a separate PR.

Copy link
Contributor

@ericyhwang ericyhwang left a comment

Choose a reason for hiding this comment

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

LGTM from Nate during PR review meeting, apologies for dropping the ball!

@ericyhwang ericyhwang merged commit 588167c into share:master Apr 10, 2019
@ericyhwang
Copy link
Contributor

This is published as sharedb@1.0.0-beta.22

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.

None yet

4 participants