Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Recurring Payments: Add postId to Stripe connection URL state param #13398
Recurring Payments: Add postId to Stripe connection URL state param #13398
Changes from all commits
34f72bf
6ccf747
39e087c
b0d60ab
bf08ece
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this 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 add tracking here but that's good for a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#13394 does that 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it only does in case we're using the Stripe Connect Nudge, but not if we're still using the in-block connect button 🙁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to guard here for potentially undefined window?
cc @ockham
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a redirect like this in the block nudge already. I'm not sure it's dangerous to have
window
unguarded in cases like this; while we do use the block nudge for server side rendering, it's only the plain 'dumb' component rather than thewithDispatch()
case, so we're not actually ever using it in a context wherewindow
doesn't exist -- and I think we'd notice pretty much immediately if we did, since it'll totally break the build. (The same argument applies to this occurrence.)My take would thus be YAGNI -- let's only add it once we need it, e.g. if the build fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense I guess. I am not familiar with the server side rendering stuff - just curious as you mentioned it previously. So YAGNI - if the build fails, then fix? Not sure that was the case previously tbh (I don't remember builds failing, but it was a fairly different case + may be wrong/missing something). I'm clueless on the ssr stuff. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good question, guarding browser globals is cheap and saves pain down the road. The problem here is that none of this code block makes sense outside the browser. We can't
event.preventDefault
if we can't handle the redirect. That leads to being unable to save the content before navigation, and at that point we might as well just error.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What Jon said -- it's just a
noop
outside the browser (we do however have anhref
in the 'dumb' component as the fallback for the SSR case, so anoop
should be okay -- but we essentially do that, at least in the Upgrade Nudge case, by using the dumb rather than the smart component in SSR).