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

Avoid a possible error when linking accounts due to the delay between Google APIs #2412

Merged

Conversation

eason9487
Copy link
Member

Changes proposed in this Pull Request:

PT: pcTzPl-2iK-p2

It's an additional fix for a bug found while testing #2215.

This PR avoids a possible error when linking accounts due to the delay between Google APIs of Google Merchant Center and Google Ads. Please refer to the Additional details section for the issue details.

  • Add a retry mechanism to the API\Google\Ads::get_merchant_link method.

💡 After a few rounds of testing, I could get an invitation link on the first retry in my dev environment, so I set the number of retries to 3.

Screenshots:

Kapture.2024-05-27.at.16.39.50.mp4

Detailed test instructions:

  1. Disconnect Google Ads account if there is a connected one.
  2. Go to step 1 of the onboarding flow.
  3. Connect a Google Merchant Center account first.
  4. Create a new Google Ads account and claim it.
  5. Check if the “Merchant link is not available to accept” error doesn't occur.

Additional details:

Looks like after updating Google API to v16 (#2386), the invitation link may not be available in Google Ads immediately after the invitation is sent from Google Merchant Center. This may result in a “Merchant link is not available to accept” error when linking to a newly created Google Ads account.

The error when linking accounts

1

An invitation was sent but left as pending approval

2

The way to reproduce the issue

Kapture.2024-05-27.at.16.19.14.mp4

Changelog entry

@eason9487 eason9487 requested a review from a team May 27, 2024 09:50
@eason9487 eason9487 self-assigned this May 27, 2024
@github-actions github-actions bot added the changelog: tweak Small change, that isn't actually very important. label May 27, 2024
Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.6%. Comparing base (24c494e) to head (6e54e69).
Report is 696 commits behind head on feature/seamlessly-conversion-tracking.

Additional details and impacted files

Impacted file tree graph

@@                            Coverage Diff                             @@
##             feature/seamlessly-conversion-tracking   #2412     +/-   ##
==========================================================================
+ Coverage                                      62.2%   64.6%   +2.4%     
- Complexity                                     4209    4275     +66     
==========================================================================
  Files                                           748     459    -289     
  Lines                                         21615   16862   -4753     
  Branches                                        533       0    -533     
==========================================================================
- Hits                                          13436   10886   -2550     
+ Misses                                         7727    5976   -1751     
+ Partials                                        452       0    -452     
Flag Coverage Δ
js-unit-tests ?
php-unit-tests 64.6% <100.0%> (+0.7%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/API/Google/Ads.php 88.6% <100.0%> (-6.0%) ⬇️

... and 490 files with indirect coverage changes

Copy link
Member

@ianlin ianlin left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the bug by adding the retry. I could reproduce the bug and this PR solved it in my local. Also confirmed in the Google Ads dashboard there were no pending invitation. 👍

@eason9487 eason9487 merged commit d23a5db into feature/seamlessly-conversion-tracking May 29, 2024
14 checks passed
@eason9487 eason9487 deleted the tweak/retry-get-merchant-link branch May 29, 2024 03:36
@eason9487 eason9487 changed the title Avoid a possible error when linking accounts due to the delay between Google APIs. Avoid a possible error when linking accounts due to the delay between Google APIs May 29, 2024
@mikkamp mikkamp mentioned this pull request Jun 10, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: tweak Small change, that isn't actually very important.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants