Skip to content

refactor/introduce IContext - #9062

Draft
max-nextcloud wants to merge 15 commits into
refactor/file-servicefrom
refactor/introduce-icontext
Draft

refactor/introduce IContext#9062
max-nextcloud wants to merge 15 commits into
refactor/file-servicefrom
refactor/introduce-icontext

Conversation

@max-nextcloud

@max-nextcloud max-nextcloud commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator
  • chore(refactor): Introduce IContext and FileContext
  • chore(refactor): simplify IContext API with helper classes

Todo

Backend

  • Handle sync requests with IContext.
  • get text file in AttachmentService based on context.
  • Fix unit tests for ApiService.
  • Fix 412 resonses to push requests.
  • handle saving in IContext.
  • check for other requests that rely on the context.
  • Have a lazy context that does not setup the filesystem unless needed.
  • always create the context on the same layer.
  • Add index for context_type, context_id.
  • Migrate existing documents.

Frontend

  • Add context arguments to createCollaborativeEditor.
  • Pass these arguments to the CollaborativeEditor component as props.
  • Use these props to connect.
  • Provide these props when saving.

@max-nextcloud
max-nextcloud force-pushed the refactor/introduce-icontext branch 9 times, most recently from 3e17210 to a2260eb Compare August 17, 2026 10:44
@max-nextcloud max-nextcloud changed the title refactor/introduce icontext refactor/introduce IContext Aug 17, 2026
@max-nextcloud
max-nextcloud force-pushed the refactor/introduce-icontext branch 4 times, most recently from ae7bbf6 to 92e1890 Compare August 17, 2026 13:20
@max-nextcloud
max-nextcloud force-pushed the refactor/file-service branch 4 times, most recently from c9d35f7 to cd2d5b9 Compare August 18, 2026 18:29
@max-nextcloud
max-nextcloud force-pushed the refactor/introduce-icontext branch from b0a7b15 to 7cedf66 Compare August 18, 2026 18:50
@max-nextcloud
max-nextcloud force-pushed the refactor/file-service branch from cd2d5b9 to c4cca9f Compare August 19, 2026 04:32
@max-nextcloud
max-nextcloud force-pushed the refactor/introduce-icontext branch from 7cedf66 to 1bb5586 Compare August 19, 2026 04:34
@max-nextcloud
max-nextcloud force-pushed the refactor/file-service branch 2 times, most recently from 7232808 to 5907ff4 Compare August 19, 2026 05:35
* `checkSharePermissions` has not been throwing `NotPermittedException` for a while.
  See #3765 .
* `InvalidArgumentException` was not being handled.
* throw `NotFoundException` if file cannot be found and there is no share token.

Signed-off-by: Max <max@nextcloud.com>
Use it for creating the session for now.

Signed-off-by: Max <max@nextcloud.com>
For some reason `$document->getId` is suspected to return void by vscode.
`$document->id` is public. So use that instead.

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>
Two api endpoints deserve two different functions
in particular as they also expect different params.

This also allows narrowing down the types a little more.

Signed-off-by: Max <max@nextcloud.com>
Still missing the actual database migration on the backend
and the props etc. on the frontend.

Signed-off-by: Max <max@nextcloud.com>
@max-nextcloud
max-nextcloud force-pushed the refactor/introduce-icontext branch from 1bb5586 to 8db2f87 Compare August 19, 2026 05:44
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
…ption

This saves one file read and makes handling the exception easier

Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Non-file contexts will need to return null.

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 refactor/introduce-icontext branch from 8db2f87 to 3436fa3 Compare August 19, 2026 05:56
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