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

Use GMT date when fetching cancellation orders. #43641

Merged
merged 4 commits into from Jan 15, 2024
Merged

Use GMT date when fetching cancellation orders. #43641

merged 4 commits into from Jan 15, 2024

Conversation

vedanshujain
Copy link
Contributor

@vedanshujain vedanshujain commented Jan 15, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

In get_unpaid_orders the passed $date parameter is a timezone-based timestamp, but we used it as a UTC-based timestamp. This caused issues as the function will return unpaid orders not yet eligible for cancellation and would cancel it, in timezones that are ahead of UTC (countries towards the east of the GMT line).

This is fixed by converting the timestamp to UTC before comparing it with the order-modified timestamps.

Closes #43593

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Set HPOS to authoritative, set the hold stock setting to 60 min in WooCommerce > Settings > Products > Inventory
  2. Set the WordPress site time zone to any timezone greater than +1 UTC, such as IST (which is +5:30)
  3. Check out an order with any product via checkout flow.
  4. Open the new order in wc-admin, and set the order status to pending payment.
  5. Using the CLI, manually run the cron job for cancelling unpaid order like so: wp eval "wc_cancel_unpaid_orders();"
  6. Refresh the order admin page for the new order. Check that it's not cancelled.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Comment

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Jan 15, 2024
Copy link
Contributor

github-actions bot commented Jan 15, 2024

Test Results Summary

Commit SHA: bd2c611

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests258002102793m 49s

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.

@vedanshujain vedanshujain marked this pull request as ready for review January 15, 2024 07:07
@vedanshujain vedanshujain requested review from a team, coreymckrill, lsinger and Konamiman and removed request for a team and coreymckrill January 15, 2024 07:52
Copy link
Contributor

github-actions bot commented Jan 15, 2024

Hi @lsinger, @Konamiman,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@Konamiman Konamiman merged commit e1f57da into trunk Jan 15, 2024
53 checks passed
@Konamiman Konamiman deleted the fix/43593 branch January 15, 2024 08:09
@github-actions github-actions bot added this to the 8.6.0 milestone Jan 15, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Jan 15, 2024
@Konamiman Konamiman mentioned this pull request Jan 15, 2024
5 tasks
@nigeljamesstevenson nigeljamesstevenson modified the milestones: 8.6.0, 8.5.0 Jan 15, 2024
nigeljamesstevenson pushed a commit that referenced this pull request Jan 15, 2024
* Use GMT date when fetching cancellation orders. (#43641)

* Prep for cherry pick 43641

---------

Co-authored-by: Vedanshu Jain <vedanshu.jain.2012@gmail.com>
Co-authored-by: WooCommerce Bot <no-reply@woo.com>
@nigeljamesstevenson nigeljamesstevenson added needs: internal testing Indicates if the PR requires further testing conducted by Solaris status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: internal testing Indicates if the PR requires further testing conducted by Solaris plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HPOS] Orders can be prematurely cancelled
4 participants