-
Notifications
You must be signed in to change notification settings - Fork 121
[Local catalog] Fix observation of variation attributes #16400
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
Conversation
|
|
iamgabrielma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| // Fetch parent product with updated attributes | ||
| struct ParentProductWithAttributes: Decodable, FetchableRecord { | ||
| let product: PersistedProduct | ||
| let attributes: [PersistedProductAttribute]? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Does attributes need to be nullable here? (I think is always present but could be empty) Otherwise we can remove the optional and simplify the nil-coalescing below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch

Follows #16399
Description
This PR updates the displayed variations in an item list when their names change.
Previously, we observed changes to the variation, but not its attributes. Attributes make up the name of a variation, so it meant we didn't update the name when we needed to.
To fix that, we observe the attributes and variation attributes, and make sure we delete and recreate them on incremental updates.
Test Steps
Screenshots
variation.name.changes.mp4
RELEASE-NOTES.txtif necessary.