Make the directory toggle visible, move it under the shareable link, self-heal the link - #112
Merged
Merged
Conversation
Three separate reasons a user saw no toggle at all, and the same reason the directory kept showing the raw gateway URL. IT HID ITSELF ON ANY FAILURE The switch rendered nothing whenever the server state could not be read, on the reasoning that a wrong switch is worse than no switch. That was wrong. When the listing endpoint was unreachable - which it was, because the endpoint had not been deployed - the control silently ceased to exist, and the only signal was a user hunting for a feature that looked unshipped. It now always renders: disabled, saying the directory is unavailable, or Checking while it loads. A disabled control that says why is honest; an absent one is not. IT WAS IN THE WRONG PLACE It sat below the Open / Copy / Recreate actions, reading as an afterthought. Listing is a statement about the shareable link, so the switch now sits directly under it. THE LINK NEEDED A MANUAL TOGGLE FLIP TO REPAIR A site listed before this client began sending the stable share link has listing_url NULL server-side, so the directory falls back to the raw per-generation gateway URL - which points at ONE build and goes stale on the next regeneration. The server CANNOT work the real address out: the IPNS pointer lives in the user's encrypted manifest and is published to w3name from the browser, so only the client can supply it. Rather than ask a user to toggle listing off and on to fix data they did not break, opening the site now pushes the front door once, guarded by listed AND NOT hasStableUrl AND a known pointer, attempted at most once per group per session, failures swallowed. hasStableUrl is now read off the GET (it was already returned and thrown away), and a toggle records whether the server ACCEPTED the URL rather than assuming it - a rejected link must not suppress the repair. NOT VERIFIED LOCALLY: flutter analyze cannot run on this machine, PID 15560 is holding 1,002,673 handles and every fork fails. CI is the gate.
Placed as asked, and the placement matters more than it looks. The switch was inside a generation-history card, gated on that card being the newest completed build - so finding it meant scrolling past the assets and into the history, and only one card in that list had it. It now sits directly under the Shareable link block at the top of the screen. Deliberately BELOW that block rather than inside it: the link card collapses to a spinner while the IPNS pointer is publishing, and to nothing at all when there is no pointer yet. Nesting the switch there would have made it vanish again whenever an unrelated thing was loading - the same class of bug as hiding it when the server state could not be read. It is its own bordered section keyed only on there being a completed generation. Drops _GenerationCard.isLatestCompleted and _latestCompletedId, now unused, in favour of a _latestCompleted getter returning the generation itself. Still CI-verified only - flutter cannot run here, PID 15560 is holding over a million handles.
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.
Three reasons a user could not find the directory toggle, and the reason the directory kept showing the raw gateway URL.
It hid itself on any failure. The switch rendered nothing whenever the server state could not be read - reasoning that a wrong switch is worse than no switch. That was wrong. The listing endpoint was not deployed, so the control silently ceased to exist and the only signal was a user hunting for a feature that looked unshipped. It now always renders: disabled with
Directory unavailable right now, orChecking…while it loads.It was in the wrong place. It lived inside a generation-history card, gated on that card being the newest completed build - so finding it meant scrolling past the assets into the history, where exactly one card had it. It now sits directly under the Shareable link block at the top.
Deliberately below that block rather than inside it: the link card collapses to a spinner while the IPNS pointer publishes, and to nothing when there is no pointer. Nesting the switch there would make it vanish whenever an unrelated thing was loading - the same bug class as hiding it on an unreadable server state.
The link needed a manual toggle flip to repair. A site listed before this client began sending the stable link has
listing_urlNULL server-side, so the directory falls back to the per-generation gateway URL - which points at ONE build and goes stale on regeneration. The server cannot derive the real address: the IPNS pointer lives in the user's encrypted manifest and is published to w3name from the browser.Rather than ask a user to toggle listing off and on to fix data they did not break, opening the site now pushes the front door once - guarded by
listed AND NOT hasStableUrl ANDa known pointer, at most once per group per session, failures swallowed.hasStableUrlis read off the GET (already returned, previously discarded), and a toggle records whether the server ACCEPTED the URL rather than assuming it, so a rejected link cannot suppress the repair.Drops
_GenerationCard.isLatestCompletedand_latestCompletedId, now unused.CI green: analyze clean, unit tests pass. Not verified locally -
fluttercannot run on this machine, PID 15560 is holding over a million handles and every fork fails.