Skip to content

Conversation

@chihsuan
Copy link
Member

@chihsuan chihsuan commented Jan 17, 2023

All Submissions:

Changes proposed in this Pull Request:

Closes #35745.

Wait for requests to finish before redirecting to make sure the wc_connect_taxes_enabled option is set synchronously.

Ideally, we should also add a test for it, but it's a bit challenging because it requires a Jetpack connection to complete the flow. I think we can tackle this problem when we start to work on the e2e project.

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

  1. In a new site, skip OBW
  2. Go to WooCommerce > Home > Add tax rates
  3. Do all the steps and connect the site
  4. Click on "Yes please" button when seeing "Jetpack and WooCommerce Tax can automate your sales tax calculations" texts.
  5. Observe that the tax task is marked as completed

You can use this release zip file for testing.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.
Screen.Recording.2023-01-17.at.16.18.37.mov

@github-actions github-actions bot added focus: react admin plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Jan 17, 2023
@chihsuan chihsuan self-assigned this Jan 17, 2023
@chihsuan chihsuan marked this pull request as ready for review January 17, 2023 08:16
@chihsuan chihsuan requested review from a team, adrianduffell and rjchow January 17, 2023 08:24
@github-actions
Copy link
Contributor

Test Results Summary

Commit SHA: 06a6fcb

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 56s
E2E Tests189006019517m 39s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

Copy link
Contributor

@ilyasfoo ilyasfoo left a comment

Choose a reason for hiding this comment

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

Awesome fix, @chihsuan! LGTM. Makes sense to not have e2e at the moment for this flow.

Copy link
Contributor

@rjchow rjchow 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 other than the comment on the dependency array!

try {
await Promise.all( [
updateAndPersistSettingsForGroup( 'tax', {
tax: {
Copy link
Contributor

Choose a reason for hiding this comment

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

not introduced by this PR, but I'm surprised there's no bug or lint complaint about taxSettings not being in the useCallback dependency array.

Do you know if it's necessary to add it?

Copy link
Member Author

@chihsuan chihsuan Jan 19, 2023

Choose a reason for hiding this comment

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

Good point! I took a quick look, and I think it's okay for new users because there are only default tax settings. But we should better add it to the dependency array to avoid some edge cases. I'll create an issue for it. We may need to look into it deeper.

Copy link
Member Author

Choose a reason for hiding this comment

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

issue created #36502

@chihsuan chihsuan merged commit 025c6aa into trunk Jan 19, 2023
@chihsuan chihsuan deleted the fix/tax-task-not-completed branch January 19, 2023 05:01
@github-actions github-actions bot added this to the 7.4.0 milestone Jan 19, 2023
adrianduffell pushed a commit that referenced this pull request Jan 20, 2023
* Wait for requests to finish before redirecting

* Add changelog
vedanshujain pushed a commit that referenced this pull request Jan 25, 2023
* Wait for requests to finish before redirecting

* Add changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tax task showing as not completed after setting up tax

4 participants