Skip to content

Key the directory toggle on the website group, not the generation - #111

Merged
ehsan6sha merged 1 commit into
mainfrom
fix/listing-toggle-group-key
Aug 24, 2026
Merged

ehsan6sha merged 1 commit into
mainfrom
fix/listing-toggle-group-key

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

The directory toggle was never visible on a finished website, and the fxfiles.top link upgrade never reached the server. Both are the same bug.

ai_generations.id is the SERVER's jobId, returned by POST /generate. WebsiteGeneration.id is a client-side uuid. They are different values - and the client discards the jobId once a job completes, so it is not recoverable later either.

The status poll used jobId correctly. The two calls I added for the directory used generation.id, so:

  • fetchListingState hit /status/<client-uuid> -> 404 -> returned null -> the switch hid ITSELF. No toggle ever rendered.
  • the completion-time listing_url push 404'd silently, which is why the directory kept showing the raw ipfs.cloud.fx.land/gateway URL instead of the stable fxfiles.top/w/<k51...> front door.

Now keyed on the website GROUP (tagId), against the new group-scoped endpoints (pinning-service#87):

GET  /api/v1/websites/:group/listing
POST /api/v1/websites/:group/listing

The group is stable across regenerations, always known to the client, and is already what the directory de-duplicates on - so one website is one entry regardless of how many times it was regenerated, and flipping the toggle later updates that same entry. _listedOnServer is re-keyed by group to match.

Needs the AI service deployed for the endpoints to exist; until then the toggle stays hidden rather than showing a control that cannot save.

v1.11.16.0. CI green: analyze clean, 971 passed / 25 skipped.

The listing switch never appeared on any finished website, and the
stable-link upgrade silently never fired. Same root cause, and it was
mine.

ai_generations.id is the SERVER's jobId, returned from POST /generate.
WebsiteGeneration.id is a CLIENT-side uuid - a different value - and the
client discards the jobId once the job completes (_clearPendingJob), so
it is not even available later.

The status poll correctly used jobId, but the two calls I added for the
directory used generation.id:
  - fetchListingState -> GET /status/<client-uuid> -> 404 -> null ->
    _DirectoryListingSwitch hid itself, so the toggle was unreachable.
  - setDirectoryListing -> POST /generations/<client-uuid>/listing -> 404,
    so listing_url stayed NULL and the directory kept showing the raw
    per-generation gateway URL.

Both now address the website GROUP (tag id) via the new group-scoped
endpoints. The group is stable, is always known here, and is already what
the directory de-duplicates on - so it also matches the product model of
one directory entry per website rather than per generation.

_listedOnServer is likewise re-keyed by group.

Server half: functionland/pinning-service.
@ehsan6sha
ehsan6sha merged commit 3dde132 into main Aug 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant