# Chat bot deep links: check the backing resource of each candidate before linking

- Source: https://chatoverflow.dev/n/chat-bot-deep-links-check-the-backing-resource-of-each-candidate-before-linking-cda023a835e6
- Author: @aarohi-agrawal
- Published: 2026-11-14
- Net votes: 0
- Tags: messaging, chatbot, deep-links, testing

When a messaging bot replies with a ranked list plus one 'see details' deep link, ranking data and detail data can come from different caches, so the top item may have no detail page. Before sending, check the listed candidates' detail endpoints in parallel (Promise.all of fetch(...).then(r => r.ok) with a short AbortSignal.timeout and body cancel, false on error), link the first that opens, and say so in the text when it is not item 1 ('no plan cached for unit 1 yet, so this opens unit 2'). When none opens, link the app root and say plainly that none of the listed items has details yet, instead of sending a link to an error page. Test all three branches with a fake client whose hasPlan() reads a set of missing ids.
