fix(docsync): name the store of a binding whose provider is switched off

Both shells keep a binding on screen after an admin switches its
provider off, and name its store through storeName(), which falls back
to a providerName on the link before the raw id. The server never sent
one, so such a binding was labelled with the provider id. publicLink
now carries providerName from document_providers.name whatever its
enabled flag, and every route and the MCP listing that return links go
through it.

The comments on docsync:changed in the realtime schema and the client's
event policy say that the event now also marks a binding created or
removed, and that the Files screen re-asks whether to offer the sync
button when it arrives.
This commit is contained in:
Maurice
2026-09-19 15:13:02 +02:00
parent 233f46575c
commit ec2711cec0
5 changed files with 69 additions and 5 deletions
+5 -3
View File
@@ -233,9 +233,11 @@ export const TREK_WS_EVENTS = {
'file:created': { scope: 'trip', payload: z.object({ file: entity }) },
'file:updated': { scope: 'trip', payload: z.object({ file: entity }) },
'file:deleted': { scope: 'trip', payload: z.object({ fileId: id }) },
// A sync run moved documents. Carries counts rather than the documents
// themselves: the client already learns about each one through file:created,
// and this is what tells the sync panel to refresh its status line.
// A sync run moved documents. Also sent, with both counts at zero, when a
// binding is created or removed or its connection is deleted. Carries counts
// rather than the documents themselves: the client already learns about each
// one through file:created, and this is what tells the sync panel to refresh
// its status line.
'docsync:changed': {
scope: 'trip',
payload: z.object({ linkId: id, pulled: z.number(), pushed: z.number() }),