fix(PacketDetailsModal): don't let a failed companion lookup discard advert names - #87
Open
npdgm wants to merge 1 commit into
Open
fix(PacketDetailsModal): don't let a failed companion lookup discard advert names#87npdgm wants to merge 1 commit into
npdgm wants to merge 1 commit into
Conversation
…advert names On a repeater with no companion bridge configured, /api/companion/contacts returns 503. The call had no individual .catch(), so the whole Promise.all rejected and the successfully fetched adverts were discarded, leaving every hop in the Repeater Path View as "Unknown contact". Catch the companion lookup like the advert lookups so advert-based name resolution still applies. extractArrayPayload(null) already yields []. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a repeater with no companion bridge configured, every hop in the packet details modal's "Repeater Path View" shows "Unknown contact", even though the neighbors are known and displayed correctly on the Monitoring/Neighbors page.
Cause
In
refreshContactLookup(), the advert lookups each have an individual.catch(() => null), but the/companion/contactscall does not. Without a companion bridge the backend legitimately returns 503 "No companion bridges configured", which rejects the outerPromise.all— and the silent best-effortcatch {}then discards the successfully fetched adverts too.contactLookupEntriesstays empty, so no path hash ever resolves to a name.Present since the feature was introduced in 5d674a7.
Fix
Catch the companion lookup the same way as the advert lookups.
extractArrayPayload(null)already returns[], so no other change is needed.Testing
/api/companion/contacts→ 503 and/adverts_by_contact_type→ 200.npm run type-checkpasses. The two ESLintno-unused-varserrors in this file pre-exist ondevand are untouched.