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

Fixes the item not found error by using filter in the product endpoint #2840

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

halilozanakgul
Copy link
Contributor

@halilozanakgul halilozanakgul commented Dec 16, 2024

Changes proposed in this Pull Request:

Updates the ProductCatalog/Products/Id API call to use endpoint filter instead of directly getting the product with id.

This API call is mainly used for checking if the product item exists on Meta. When the item does not exists it threw an error. With this change the endpoint will stop erroring and will return empty list as response.

Detailed test instructions:

  1. Create any product on admin page that will be synced to Meta.
  2. Check for errors.

Changelog entry

Dev - Use product GET endpoint filter function to reduce the item not found errors.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch 2 times, most recently from 3ee78c3 to 9a31f12 Compare December 16, 2024 15:28
@halilozanakgul halilozanakgul marked this pull request as ready for review December 17, 2024 12:54
*
* @link https://developers.facebook.com/docs/marketing-api/reference/product-group/products/
* @link https://developers.facebook.com/docs/marketing-api/reference/product-catalog/products/
*/
class Request extends ApiRequest {
Copy link
Contributor

Choose a reason for hiding this comment

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

Few suggestions.

1/ The file is located in folder "Id", should we rename it to "Read" instead?

2/ Please update corresponding Response.php file too.

3/ This request is being called in API.php in a function called get_product_facebook_ids, let's rename it to let's say get_product_item to be more consistent with other naming in the API.php

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this is only used to fetch the ids. I think the intent here was to make sure we can still have a separate 'read' endpoint file later if necessary. And the rest of the API calls are not consistent either.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from 9a31f12 to 6761919 Compare December 19, 2024 16:12
Copy link
Contributor

@mshymon mshymon left a comment

Choose a reason for hiding this comment

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

PR checks are failing, please fix and make sure you addressed or answered to all the PR comments.

By the way, you can remove line " Do the changed files pass phpcs checks? Please remove phpcs:ignore comments in changed files and fix any issues, or delete if not practical." on your PR description.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch 20 times, most recently from 5a73515 to df4496f Compare January 20, 2025 17:36
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from df4496f to ea5224e Compare January 22, 2025 11:10
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from ea5224e to eff97b4 Compare January 27, 2025 15:47
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from eff97b4 to c13b986 Compare January 27, 2025 16:02
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from c13b986 to c8aa287 Compare January 27, 2025 16:22
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from c8aa287 to ea1ae29 Compare January 28, 2025 11:11
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from 61d62ed to ab3d190 Compare February 4, 2025 13:01
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from ab3d190 to 086b989 Compare February 4, 2025 18:21
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@halilozanakgul halilozanakgul force-pushed the fix_item_id_find_endpoint branch from 086b989 to e8d5798 Compare February 5, 2025 20:54
@facebook-github-bot
Copy link
Contributor

@halilozanakgul has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@halilozanakgul has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

Hi @halilozanakgul!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants