Skip to content

chore(test): text with contexts - #2765

Draft
max-nextcloud wants to merge 6 commits into
mainfrom
test/text-with-contexts
Draft

max-nextcloud wants to merge 6 commits into
mainfrom
test/text-with-contexts

Conversation

@max-nextcloud

Copy link
Copy Markdown
Collaborator

No description provided.

@blizzz

blizzz commented Sep 9, 2026

Copy link
Copy Markdown
Member

AttachmentResolver needs to be adjusted yet, according to Claude:

  1. Collectives renders preview/print through window.OCA.Text.createEditor({ fileId, useSession: false }) (src/composables/useReader.ts:118) → Text's MarkdownContentEditor, which does new AttachmentResolver({ fileId }).
  2. AttachmentResolver (unchanged on the branch) POSTs { documentId: } to /apps/text/attachments.
  3. Old middleware read that param as a file id: $fileId = (int)$request->getParam('documentId') → FileService::getDocumentIdForUser($fileId, $userId).
  4. New middleware (SessionMiddleware::assertUserOrShareToken) treats it as a primary key: documentService->getDocument($documentId), and bails out with InvalidSessionException → HTTP 403 when it's null.
  5. Document ids are now snowflakes, so that lookup can never succeed with a file id.

@max-nextcloud
max-nextcloud force-pushed the test/text-with-contexts branch from ea753c9 to 879f5fa Compare September 10, 2026 06:10
@max-nextcloud
max-nextcloud force-pushed the test/text-with-contexts branch 5 times, most recently from 4f21a34 to 5694896 Compare October 3, 2026 10:28
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
@max-nextcloud
max-nextcloud force-pushed the test/text-with-contexts branch from 5694896 to 4e02d6a Compare October 5, 2026 10:04
@mejo-

mejo- commented Oct 14, 2026

Copy link
Copy Markdown
Member

@max-nextcloud I guess this PR can be closed, right?

This branch has not been deployed

No deployments
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.

3 participants