Skip to content

Answer a review, product or country deleted meanwhile without a 500 - #1128

Open
KrzysztofPajak wants to merge 1 commit into
developfrom
fix/storefront-unknown-ids
Open

KrzysztofPajak wants to merge 1 commit into
developfrom
fix/storefront-unknown-ids

Conversation

@KrzysztofPajak

Copy link
Copy Markdown
Member

Type: bugfix

Issue

A customer whose page was opened before the admin deleted something got a 500:

  • voting on a review that was deleted (No product review found with the specified id);
  • asking to be notified when a deleted product is back (No product found with the specified id);
  • choosing a deleted country: CountryService.GetStateProvincesByCountryId returned null for an unknown country, and GetStatesProvinceHandler (and the address form of an address whose country was deleted) enumerated it.

Solution

  • The review vote and the out-of-stock subscription answer 404.
  • GetStateProvincesByCountryId returns no states for a country that is gone, as it already did for no country.

Breaking changes

None.

Testing

  1. Open a product page with a review, delete the review in the admin, vote on it: 404 instead of 500.
  2. Request /country/getstatesbycountryid/?countryId=<deleted id>: an empty list (with the "select state" item) instead of a 500.

Tests: ProductControllerReviewHelpfulnessTests, CountryServiceTests (unknown country).

A customer who voted on a review, asked to be told when a product is back, or picked a country
after the admin deleted it got a 500. The review vote and the out-of-stock subscription now answer
404, and a country that is gone has no states, as one not chosen yet, which also keeps the address
form working for an address whose country was deleted.
Copilot AI balanced review requested due to automatic review settings November 26, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

2 participants