feat(docs): make chat links outlive the server, the path, and the title - #58
Conversation
Every link the archivist posted into a room carried the document server's address as it looked at that moment. Chat history is append-only, so changing the domain, switching between port and domain mode, or moving Paperless left every one of those links dead, with no way to rewrite them. Links now point at the stack's own resolver, which looks up where the document lives at the moment someone clicks. The resolver already existed and only the todo links used it; the five places that built an address by hand now share one builder. Document pages mirrored into the vault still store an absolute address. That is a change to the vault format and follows separately.
|
Verified on the demo rig with the real archivist. Searching Before this branch the same search produced direct Paperless URLs, e.g. Unit lane: 2200 passed, 8 skipped. ruff clean. Rebased onto current main; the duplicate Two limits worth a reviewer knowing, both visible in the same search output:
Unrelated pre-existing gap noticed while testing, not touched here: the topic-room welcome promises |
A search hit for a note or bookmark linked straight into Forgejo, at the path the file happened to have that day. That path carries the bucket, the topic slug and the title slug, and all three change under ordinary use: a capture re-scopes when a second person joins the room, a topic gets renamed, a correction rewrites the title. The link then breaks silently, still looking valid. Captures now get `/go/capture/<capture id>`, resolved at click time by finding the file that carries that id. The id is the Matrix event the capture came from, assigned once and never rewritten, so the link survives every one of those moves. This settles which links the namespace takes: entities (topic, person) are addressed by name, records (docs, capture) by an id that is never re-derived, and nothing is addressed by path. Pages with no id, such as hand-written wiki entries, keep the old link until they have one.
|
Second commit added: The decision it settles, since a link namespace is permanent: kinds come in two families. Entities ( No index. Verified on the rig. Search in and that capture link resolves: Regression check on every existing route, all still 302 correctly: Unit lane: 2211 passed, 8 skipped. ruff clean. Two things worth a reviewer's eye:
|
Every link the archivist posted into a room carried the document server's address as it looked at that moment. Chat history is append-only, so changing the domain, switching between port and domain mode, or moving Paperless left every one of those links dead, with no way to rewrite them.
Document links now point at the stack's own
/goresolver, which looks up where the document lives at click time. The resolver already existed and only the todo links used it; the five places that built an address by hand now share one builder inlib/stack/links.py.Two things this deliberately does not cover: document pages mirrored into the vault still store an absolute address (a vault-format change, following separately), and memory search hits still link to the Forgejo file view, since
/gohas no route for an arbitrary vault path.