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

scraper: skip price info request for invalid SKUs #64

Merged
merged 1 commit into from
Feb 25, 2024
Merged

Conversation

jgalar
Copy link
Owner

@jgalar jgalar commented Feb 24, 2024

Some SKUs seem to have been removed from the CT database. Unfortunately, they are still listed by the API endpoints we use to list products and SKUs.

When we attempt a PriceAvailability request for a batch of SKUs that contains an invalid SKU, the service replies with the following type of error:

  {
    "statusCode": 400,
    "errors": [
        "An error on the server occurred"
    ],
    "isCdsError": true,
    "error": "Bad Request",
    "errCode": "0",
    "xRequestId": null,
    "requestId": "3706a044-a8d1-4691-97cf-bdb78eae08c7",
    "correlationId": "f5ebd64d-8c62-4c6a-bb18-1989391cfa1a"
  }

I have not found anything in the SKU listing response that allows us to determine which SKUs are no longer valid.

For the moment, this provides a work-around by falling back to individually querying for the price of each SKU when a batch fails with the '400' status code.

Some SKUs seem to have been removed from the CT database. Unfortunately,
they are still listed by the API endpoints we use to list products and
SKUs.

When we attempt a PriceAvailability request for a batch of SKUs that
contains an invalid SKU, the service replies with the following kind of
error:

  {
    "statusCode": 400,
    "errors": [
        "An error on the server occurred"
    ],
    "isCdsError": true,
    "error": "Bad Request",
    "errCode": "0",
    "xRequestId": null,
    "requestId": "3706a044-a8d1-4691-97cf-bdb78eae08c7",
    "correlationId": "f5ebd64d-8c62-4c6a-bb18-1989391cfa1a"
  }

I have not found anything in the SKU listing response that allows us to
determine which SKUs are no longer valid.

For the moment, this provides a work-around by falling back to
individually querying for the price of each SKU when a batch fails with
the '400' status code.

Signed-off-by: Jérémie Galarneau <[email protected]>
@jgalar jgalar merged commit b1d1652 into main Feb 25, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

1 participant