Hosted onhoraciohdev.dev.hyper.mediavia theHypermedia Protocol

What is ListDocumentCollaborators and why is it so slow?

ListDocumentCollaborators is basically the network request for the document’s People/Collaborators view.


In this codebase, it is not the main source name used in app code. The actual code path is:

    useCollaborators(docId)
    frontend/packages/shared/src/models/entity.ts:648

    which calls useCapabilities(docId)

    which runs the query client.request('ListCapabilities', {targetId})
    frontend/packages/shared/src/models/queries.ts:294

    implemented by ListCapabilities
    frontend/packages/shared/src/api-capabilities.ts


So, conceptually:

ListDocumentCollaborators = “load collaborators for this document” but in code it’s implemented via capabilities, not a separate collaborator RPC.

Why: collaborators are derived from the document’s access grants/capabilities.

Related UI:

    CollaboratorsPage / People tab
    frontend/packages/ui/src/collaborators-page.tsx

Recap


ListDocumentCollaborators is the network-level collaborator-loading request, but the code mostly calls it ListCapabilitiesand derives collaborators from those capabilities.

    Main hook: useCollaborators(docId) in frontend/packages/shared/src/models/entity.ts

    Actual request: client.request('ListCapabilities', {targetId}) in frontend/packages/shared/src/models/queries.ts

    Request implementation: frontend/packages/shared/src/api-capabilities.ts

    UI using it: frontend/packages/ui/src/collaborators-page.tsx


Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime