Conversation
…variant ID lookup, enhance Solr query for preorder sync, and robustify Solr response parsing.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where Shopify listing data and promise dates were not correctly displayed in the product audit view. It enhances the application's ability to retrieve and parse Shopify sync records by improving variant ID lookups, handling shop-specific Solr filters, and adding robust safety checks for potentially missing metafield data, thereby preventing UI errors and ensuring accurate data presentation. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses issues with Shopify listing displays and Solr parsing. The changes, including corrected Solr filter formats, improved variant ID lookups with fallbacks, and added safety checks for parsing Shopify sync records, are well-implemented and enhance the application's robustness. I have a couple of suggestions to further improve type safety and code reuse.
| visibleFeatures(): any { | ||
| return Object.entries(this.features).filter(([, featureOptions]: any) => featureOptions.length > 1); | ||
| } |
There was a problem hiding this comment.
For better type safety and code clarity, it's recommended to avoid using any. Based on how features is populated, you can use more specific types for the computed property's return value and its filter callback.
visibleFeatures(): [string, string[]][] {
return Object.entries(this.features).filter(([, featureOptions]: [string, string[]]) => featureOptions.length > 1);
}
| } else { | ||
| // Fallback to searching for any shopify variant ID if specific one is not found | ||
| const shopifyIdentification = this.currentVariant.goodIdentifications?.find((id: string) => id.startsWith('ShopifyShopProduct/')); | ||
| if (shopifyIdentification) { | ||
| shopifyShop.variantProductId = shopifyIdentification.split('/')[2]; | ||
| } | ||
| } |
There was a problem hiding this comment.
The fallback logic to find a Shopify variant ID is very similar to the existing getProductIdentificationId method. To promote code reuse and ensure consistent handling of edge cases (like splitting the identification string), you could reuse that method here for the fallback.
} else {
// Fallback to searching for any shopify variant ID if specific one is not found
const fallbackVariantProductId = this.getProductIdentificationId(this.currentVariant.goodIdentifications, 'ShopifyShopProduct/');
if (fallbackVariantProductId) {
shopifyShop.variantProductId = fallbackVariantProductId;
}
}
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8fbdf46a28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const shopifyIdentification = this.currentVariant.goodIdentifications?.find((id: string) => id.startsWith('ShopifyShopProduct/')); | ||
| if (shopifyIdentification) { | ||
| shopifyShop.variantProductId = shopifyIdentification.split('/')[2]; |
There was a problem hiding this comment.
Stop reusing another shop’s variant ID as fallback
In prepareShopListings, the new fallback uses the first ShopifyShopProduct/* identification when the current shopId mapping is missing, so a store without its own mapping can end up querying Solr with a different store’s Shopify variant ID. That produces incorrect listing/promise-date data for the wrong shop instead of leaving the shop as unmapped, which directly corrupts the audit view for multi-store variants where one store mapping is absent.
Useful? React with 👍 / 👎.
…remove ambiguous variant ID fallback
This PR fixes the issue where Shopify listing data and promise dates were not displaying in the product audit view. It improves variant ID lookups, handles shop-specific Solr filters, and adds safety checks for parsing Shopify sync records.
Key changes: