Remaining edge paths for an instance with no address

Aperta
#2,022 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
53/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
react, typescript

Direzione di ricerca

Start with src/features/auth/ClusterInstanceSignIn.tsx, src/features/instance/instanceLayoutRoute.ts, src/features/cluster/Instances.tsx, useInstanceMenuItems.tsx, and ClusterHome.tsx; trace the URL helper and byInstanceFqdnThenPort mentioned in the issue. Check the sign-in, remembered connection, URL display and copy, sorting, and Disconnect paths for address-less instances, while preserving Local Studio's fallback. Done when each path handles missing or invalid addresses consistently and the existing behavior is checked.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

Some edge paths around an instance Studio has no address for are still unhandled. Both predate the #2020 fix and were found by code trace during its review; neither is observed in production.

1. The sign-in health probe fires before it knows where to go

ClusterInstanceSignIn (src/features/auth/ClusterInstanceSignIn.tsx) runs getInstanceHealthQueryOptions whenever the cluster isn't terminated. Two states send that GET /health somewhere unintended:

  • While the cluster query is still loading, operationsUrl is null, so getInstanceClient falls back to a stored sign-in URL or the page's own origin.
  • When the route's instanceId isn't in cluster.instances, the memo takes the cluster branch and probes the cluster's URL instead.

A plain !!operationsUrl gate would break Local Studio, which has no cluster and relies on the same fallback, so the gate needs to keep that case (for example isLocalStudio || !!operationsUrl).

2. A remembered sign-in reopens an instance that has lost its address

On reload, checkClusterInstanceAuthenticationBeforeLoad (src/features/instance/instanceLayoutRoute.ts) resumes a remembered connection before it reaches the Fabric Connect attempt that now refuses an address-less instance. So an instance that was signed in while it had an FQDN still opens after central manager stops listing one, through the stored URL or the proxy, while its row on the Instances list shows —.

3. Raw FQDN checks disagree with the URL helper

getOperationsUrlForInstance returns null for an FQDN that new URL rejects (whitespace-only, a bare https://), but the self-hosted URL column (src/features/cluster/Instances.tsx), the menu's copy actions (useInstanceMenuItems.tsx) and byInstanceFqdnThenPort still test the raw field for truthiness. Such a value gets a garbled URL cell, copy actions, and a sort position ahead of real addresses. Hypothetical (central manager has not been seen to send one) and cosmetic; nothing throws. Fix by normalising the address once.

4. Self-hosted Disconnect with an address-less first instance

ClusterHome.tsx's Disconnect passes getOperationsUrlForInstance(firstInstance), which can now be null, so getInstanceClient falls back to the stored sign-in URL. A connected instance always has one, so this looks correct; recorded so it gets checked rather than assumed.

Related: #2021 (cluster sign-out can't clear such an instance).

Review-Deferral: b326cc50556fa97a severity=nit category=correctness
Review-Deferral: aa30a9bb10d1ee30 severity=nit category=correctness
Review-Deferral: d4ecec465c740ecf severity=nit category=correctness
Review-Deferral: 1e45c35cbd41a55f severity=nit category=reliability

🤖 Generated by Claude Code (Claude Opus 5.5); posted via @dawsontoth.

Lingua principale
TypeScript
Stelle
5
Fork
4
Merge medio
1g 19h
PR unite (30g)
144

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HarperFast/studio

Tutte le issue di HarperFast/studio

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.