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

Notices are triggered due to scheduling AS jobs too early #9434

Closed
vladolaru opened this issue Sep 13, 2024 · 0 comments · Fixed by #9435
Closed

Notices are triggered due to scheduling AS jobs too early #9434

vladolaru opened this issue Sep 13, 2024 · 0 comments · Fixed by #9435
Assignees
Labels
focus: ops General (non dev) operations bugs and enhancements, not matching any other focus area type: bug The issue is a confirmed bug.

Comments

@vladolaru
Copy link
Contributor

Describe the bug

Sometimes we try to schedule ActionScheduler jobs via the WC_Payments_Action_Scheduler_Service::schedule_job() method before the ActionScheduler was properly initialized. This triggers a "doing it wrong" notice (see ActionScheduler::is_initialized()).

To Reproduce

Most consistently, this can be reproduced by clearing the account cache:

  1. Make sure you have WP_DEBUG active
  2. Go to WP admin > WCPay Dev Tools and clear the account cache
  3. You should see a notice at the top of the page:
Notice: Function as_has_scheduled_action was called incorrectly. as_has_scheduled_action() was called before the Action Scheduler data store was initialized Please see [Debugging in WordPress](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/) for more information. (This message was added in version 3.1.6.)

Additional context

p1719838546986229-slack-C03KTTK2YMA

@vladolaru vladolaru added the type: bug The issue is a confirmed bug. label Sep 13, 2024
@vladolaru vladolaru self-assigned this Sep 13, 2024
@bborman22 bborman22 added the focus: ops General (non dev) operations bugs and enhancements, not matching any other focus area label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: ops General (non dev) operations bugs and enhancements, not matching any other focus area type: bug The issue is a confirmed bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants