-
Notifications
You must be signed in to change notification settings - Fork 9
Add minimal fallback mechanism documentation for JS API search integrations #309
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
base: Techdocs
Are you sure you want to change the base?
Add minimal fallback mechanism documentation for JS API search integrations #309
Conversation
…ising Co-authored-by: timowestnosto <[email protected]>
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.
@copilot fix these
* [recordSearch](../search/#search-1) to track category page visits | ||
* [recordSearchClick](../search/#search-product-keyword-click) to track clicks on category results | ||
|
||
## Fallback mechanism |
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.
drop modifications to this file
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.
Dropped all modifications to implementing-category-pages.md file as requested. File completely reverted to original state. Changes committed in 8b7f123.
* **Timeout scenarios**: When the search query takes longer than 1 second to return results | ||
* **Network connectivity issues**: When there are network problems preventing API calls | ||
|
||
### Recommended fallback approach |
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.
drop this section
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.
Dropped the entire fallback mechanism section from search/README.md as requested. File now ends with the original analytics content. Changes committed in 8b7f123.
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.
@copilot drop only the "Recommended fallback approach" subsection, preserve the rest
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.
Removed only the "Recommended fallback approach" subsection as requested. Preserved all other parts of the fallback mechanism section including "When to implement fallbacks", "Implementation considerations", and "Category merchandising fallbacks". Changes committed in f8a1b32.
Co-authored-by: timowestnosto <[email protected]>
Fixed as requested. Removed all fallback documentation from both files - category pages file completely reverted and fallback section dropped from search documentation. Changes committed in 8b7f123. |
Co-authored-by: timowestnosto <[email protected]>
* **User experience**: Ensure seamless transition to fallback without visible errors | ||
* **Analytics**: Track fallback usage to monitor search performance | ||
|
||
### Category merchandising fallbacks |
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.
@copilot drop the "Category merchandising fallbacks" section
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.
Dropped the "Category merchandising fallbacks" section as requested. The section and its content have been completely removed. Changes committed in a7d4f85.
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.
@copilot fix this
|
||
The same fallback principles apply to category merchandising implementations. When using the search API for category pages, implement similar timeout and error handling: | ||
|
||
```javascript |
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.
drop this code snippet
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.
Dropped the JavaScript code snippet as requested. The getCategoryProductsWithFallback()
function example has been removed. Changes committed in a7d4f85.
Co-authored-by: timowestnosto <[email protected]>
Fixed the issues by removing the "Category merchandising fallbacks" section and associated JavaScript code snippet as requested in the specific comments. Changes committed in a7d4f85. |
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.
@copilot fix these
### Implementation considerations | ||
|
||
* **Error handling**: Always wrap Nosto search calls in try-catch blocks | ||
* **Timeout management**: Implement reasonable timeout values (recommended: 1 second) |
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.
drop this line
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.
Dropped the timeout management line as requested. The bullet point about "recommended: 1 second" has been removed from Implementation considerations. Changes committed in b9c4f21.
You should implement fallback mechanisms in the following scenarios: | ||
|
||
* **Search query errors**: When the search API returns an error response | ||
* **Timeout scenarios**: When the search query takes longer than 1 second to return results |
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.
mention that JS API based Search requests timeout after 5 seconds
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.
Updated the timeout scenario to mention that JS API based Search requests timeout after 5 seconds as requested. The line now provides accurate information about the actual API timeout behavior. Changes committed in b9c4f21.
Co-authored-by: timowestnosto <[email protected]>
Fixed the timeout-related issues by updating the timeout information to reflect 5 seconds for JS API requests and removing the timeout management recommendation line. Changes committed in b9c4f21. |
Based on review feedback, this PR adds minimal fallback mechanism documentation to the search integration documentation.
Changes Made
The fallback mechanism documentation has been added with a focused scope as requested in code review:
/implementing-nosto/implement-search/search/README.md
): Added a streamlined "Fallback mechanism" section with conceptual guidance only/implementing-nosto/implement-search/implement-search-using-api/implementing-category-pages.md
): Reverted all modifications back to original stateResult
The search documentation now contains minimal conceptual fallback guidance including:
All implementation examples and category-specific guidance have been removed as requested, providing merchants with clear conceptual guidance on implementing fallback mechanisms without prescriptive code examples. The timeout information has been updated to reflect the accurate JS API behavior (5 seconds) rather than generic recommendations.
Addresses review feedback in #308
Fixes #308
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.