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

Wait for pending transactions from ReactServerRenderingTransaction #7033

Merged
merged 1 commit into from Jul 8, 2016

Conversation

aweary
Copy link
Contributor

@aweary aweary commented Jun 13, 2016

Resolves #6423

The issue I found with #6423 was that there were pending actions from a ReactServerRenderingTransaction, so after it reverted the batching strategy after the first transaction any updates that the pending transaction(s) may have had queued were batched with ReactDefaultBatchingStrategy which caused it to fail.

This PR simply tracks the number of pending ReactServerRenderingTransaction instances and only reverts the batching strategy once the final transaction has finished.

@gaearon
Copy link
Collaborator

gaearon commented Jun 14, 2016

@spicyj can you please review this?

@sophiebits sophiebits self-assigned this Jun 16, 2016
},
});
expect(
ReactServerRendering.renderToString.bind(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just use an arrow here? I think this would be a bit less confusing.

Copy link
Contributor Author

@aweary aweary Jul 7, 2016

Choose a reason for hiding this comment

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

Do you want me to change the other instances of this? I was just following the format of the other tests in this file. (see ReactServerRendering-test.js#L265-L268)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah okay, let's keep it then.

@gaearon
Copy link
Collaborator

gaearon commented Jul 7, 2016

Let’s make those small changes and get this in. The fix is a bit ugly but the whole “revert injection” thing is problematic by itself, and at least we have a test now for this. Thanks!

@aweary
Copy link
Contributor Author

aweary commented Jul 7, 2016

Yeah, it's definitely not a long term solution. Ideally pending transactions would never be processed by a batching strategy other than the one it was batched with, but that seems like it would involve more work towards how transactions are processed.

I'll get this fixed tomorrow morning 👍

@aweary
Copy link
Contributor Author

aweary commented Jul 8, 2016

@gaearon I made those changes you requested

@gaearon gaearon added this to the 15-next milestone Jul 8, 2016
@gaearon gaearon merged commit b6e1eb2 into facebook:master Jul 8, 2016
@gaearon
Copy link
Collaborator

gaearon commented Jul 8, 2016

Thank you for numerous contributions!

@aweary
Copy link
Contributor Author

aweary commented Jul 8, 2016

Thank you for numerous contributions!

Thanks for the feedback! Looking forward to making more contributions when I can 😄

@zpao zpao modified the milestones: 15-next, 15.2.1 Jul 8, 2016
usmanajmal pushed a commit to usmanajmal/react that referenced this pull request Jul 11, 2016
@ghost ghost added the CLA Signed label Jul 12, 2016
@jcfrancisco
Copy link

@aweary Hi there – this fix is listed as part of the 15.2.1 changelog, but unless I'm reading the source wrong, it does not seem to have been actually pulled in. Just wanted to give a heads up so that it can be properly included in the 15.2.2 release. (Btw, you saved my skin with this fix). cc @zpao

jcfrancisco pushed a commit to refinery29/react-build that referenced this pull request Jul 13, 2016
@aweary
Copy link
Contributor Author

aweary commented Jul 13, 2016

@jcfrancisco seems like you're right, CC @gaearon since he merged this in initially.

@zpao
Copy link
Member

zpao commented Jul 13, 2016

Oops! I think I know what happened. I'll make sure this goes into the next release.

@zpao zpao modified the milestones: 15-next, 15.2.1 Jul 13, 2016
@aweary
Copy link
Contributor Author

aweary commented Jul 13, 2016

Thanks @zpao!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants