refactor/introduce IContext - #9062
Conversation
3e17210 to
a2260eb
Compare
ae7bbf6 to
92e1890
Compare
c9d35f7 to
cd2d5b9
Compare
b0a7b15 to
7cedf66
Compare
cd2d5b9 to
c4cca9f
Compare
7cedf66 to
1bb5586
Compare
7232808 to
5907ff4
Compare
1bc577e to
58fe27f
Compare
|
So far I read up to commit What I stumble over is that the IContext file contains the additional classes Maybe this is also OK, just to double check: a call to No biggie: new classes miss the Can consider to mark the new event unstable or experimental, though I am not aware of a phpdoc or internal established annotation. |
|
On my dev instance I get an error during Migration: {
"reqId": "miQrQfvExjkhgL8Z3V6T",
"level": 3,
"time": "2026-08-19T14:14:45+00:00",
"remoteAddr": "",
"user": "--",
"app": "updater",
"method": "",
"url": "--",
"scriptName": "occ",
"message": "\\OC\\Updater::failure: Exception: Database error when running migration 090000Date20260817110024 for app text\nAn exception occurred while executing a query: SQLSTATE[23502]: Not null violation: 7 ERROR: column \"context_type\" of relation \"oc_text_documents\" contains null values",
"userAgent": "--",
"version": "35.0.0.3",
"occ_command": [
"occ",
"upgrade"
],
"data": {
"app": "updater"
}
}DB is postgres. Probably happens because the column is added as UPDATE: same with context_id. Default to 0? |
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>
518d031 to
30117ba
Compare
Still missing the actual database migration on the backend and the props etc. on the frontend. Signed-off-by: Max <max@nextcloud.com>
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>
Signed-off-by: Max <max@nextcloud.com>
We handle the NoLockProviderException gracefully anyway. Signed-off-by: Max <max@nextcloud.com>
Addresses #9028 (comment) . Signed-off-by: Max <max@nextcloud.com>
…entsController Most controllers use the `token` parameter for shares. The AttachmentsController however uses the `shareToken` parameter. This prevented `assertDocumentSession` from passing, as the middleware always tried to set a userId which was not present. Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
* Start without `notnull`. * Migrate data so `context_type` and `context_id` are filled. * Set `notnull` on those columns. Signed-off-by: Max <max@nextcloud.com>
* Return the schema - even if the migrations do nothing. * Use the plain column name of the column to set. Fixes the migration on postgres DB. Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
224c210 to
a78e0b7
Compare
Signed-off-by: Max <max@nextcloud.com>
When creating a new session we load the document by context. Signed-off-by: Max <max@nextcloud.com>
a78e0b7 to
41ea7a5
Compare
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Droped in a7a63d2 . Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
Todo
Backend
syncrequests with IContext.AttachmentServicebased on context.ApiService.pushrequests.Frontend
Provide these props when saving.We still use thedocumentIdto save and resolve the context on the backend.Testing
Documentation