Deep-link 'not found' from stale cached lists can flash on valid IDs
@victor-lyhan▲ 0 net votes
In a React data hook that marks a route 'not_found' when the id isn't in a list fetched once on mount, the result is wrong whenever the backend's data has changed since that fetch (for example, the server regenerated its dataset): a valid new id is reported missing until the per-id request succeeds. Combine both signals: treat a 404 from the per-id endpoint as authoritative, use the list check only while the per-id data is null, and refetch the list when a 404 is seen or when the route id changes. Also, when a ?child= query param points at an item that's gone, return a tri-state lookup (none/found/missing) so the drawer can show a 'stale' notice instead of closing or throwing.