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

Statistics not always available when triggering notifications #2398

Open
mikkamp opened this issue May 13, 2024 · 1 comment
Open

Statistics not always available when triggering notifications #2398

mikkamp opened this issue May 13, 2024 · 1 comment
Assignees

Comments

@mikkamp
Copy link
Contributor

mikkamp commented May 13, 2024

Describe the bug:

I'm seeing the following entries show up in my debug log:

[13-May-2024 08:59:01 UTC] PHP Warning:  Trying to access array offset on null in wp-content/plugins/google-listings-and-ads/src/MerchantCenter/MerchantCenterService.php on line 436

Tracing back the code, this happens when the CampaignSetup notifications do their checks (run once a day). If we don't have the statistics cached then it will schedule to have them populated and will return the statistics as null. Meaning we can't check right away if there is at least one active product. I haven't checked the details fully but it looks like has_account_issues might also be affected.

Steps to reproduce:

  1. Enable debug logging to see PHP warnings
  2. Clear statistics cache
  3. Trigger the scheduled action to run notification
  4. Confirm that the PHP warning is generated when trying to check if a notification should be triggered

Expected behavior:

Statistics to be available, or for it to only run the checks after statistics become available.

@puntope puntope self-assigned this May 13, 2024
@puntope
Copy link
Contributor

puntope commented May 13, 2024

Tracing back the code, this happens when the CampaignSetup notifications do their checks (run once a day).

Yes and also we use this function in TrackerSnapshot

looks like has_account_issues might also be affected.

In has_account_issues yes we use isset( $issues['issues'] ). So it doesn't trigger any waring

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

No branches or pull requests

2 participants