Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Oct 7, 2025

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:

  • Search Documentation (/implementing-nosto/implement-search/search/README.md): Added a streamlined "Fallback mechanism" section with conceptual guidance only
  • Category Pages Documentation (/implementing-nosto/implement-search/implement-search-using-api/implementing-category-pages.md): Reverted all modifications back to original state

Result

The search documentation now contains minimal conceptual fallback guidance including:

  • When to implement fallbacks (error scenarios, JS API requests timeout after 5 seconds, connectivity issues)
  • Implementation considerations (error handling, user experience, analytics)

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

This section details on the original issue you should resolve

<issue_title>Fallback documentation (2nd attempt)</issue_title>
<issue_description>Article to update:
https://docs.nosto.com/techdocs/implementing-nosto/implement-search/search

Add a "Fallback mechanism" section to the bottom of the page

For JS API integrations there is no built-in fallback functionality. Merchants need to build this themselves. The documentation should include some guidance on how to implement this fallback functionality e.g. "if the search query returns an error, or takes longer than 1 second to come back, the integration should fall back to the native search solution".
Same for Category Merchandising.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #308

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Copilot Copilot AI changed the title [WIP] Fallback documentation (2nd attempt) Add fallback mechanism documentation for JS API search integrations Oct 7, 2025
@Copilot Copilot AI requested a review from timowestnosto October 7, 2025 08:52
Copilot finished work on behalf of timowestnosto October 7, 2025 08:52
Copy link

@timowestnosto timowestnosto left a 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

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

Copy link
Author

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

Choose a reason for hiding this comment

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

drop this section

Copy link
Author

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.

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

Copy link
Author

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.

Copy link
Author

Copilot AI commented Oct 7, 2025

@copilot fix these

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.

@Copilot Copilot AI changed the title Add fallback mechanism documentation for JS API search integrations Remove fallback mechanism documentation from JS API search integrations Oct 7, 2025
Copilot finished work on behalf of timowestnosto October 7, 2025 09:57
@Copilot Copilot AI requested a review from timowestnosto October 7, 2025 09:57
@Copilot Copilot AI changed the title Remove fallback mechanism documentation from JS API search integrations Partially restore fallback mechanism documentation for JS API search integrations Oct 7, 2025
Copilot finished work on behalf of timowestnosto October 7, 2025 10:08
* **User experience**: Ensure seamless transition to fallback without visible errors
* **Analytics**: Track fallback usage to monitor search performance

### Category merchandising fallbacks
Copy link

@timowestnosto timowestnosto Oct 7, 2025

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

Copy link
Author

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.

Copy link

@timowestnosto timowestnosto left a 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

Choose a reason for hiding this comment

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

drop this code snippet

Copy link
Author

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.

Copy link
Author

Copilot AI commented Oct 7, 2025

@copilot fix this

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.

@Copilot Copilot AI changed the title Partially restore fallback mechanism documentation for JS API search integrations Add minimal fallback mechanism documentation for JS API search integrations Oct 7, 2025
@Copilot Copilot AI requested a review from timowestnosto October 7, 2025 13:41
Copilot finished work on behalf of timowestnosto October 7, 2025 13:41
Copy link

@timowestnosto timowestnosto left a 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)

Choose a reason for hiding this comment

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

drop this line

Copy link
Author

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

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

Copy link
Author

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.

Copy link
Author

Copilot AI commented Oct 7, 2025

@copilot fix these

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.

@Copilot Copilot AI requested a review from timowestnosto October 7, 2025 16:51
Copilot finished work on behalf of timowestnosto October 7, 2025 16:51
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