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? |
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>
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>
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>
Signed-off-by: Max <max@nextcloud.com>
File ids used to be document ids. But not anymore. In all current calls to `resetDocument` the parameter send actually is a file id. Follow up: Make this generic for all context types.--signoff Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
351b1b4 to
c2cdf5e
Compare
Signed-off-by: Max <max@nextcloud.com>
c2cdf5e to
336adbd
Compare
Signed-off-by: Max <max@nextcloud.com>
* Use IShare and IUser in the file context api explicitely. * Make creating the context cheap. * File is accessed when needed and then cached. Signed-off-by: Max <max@nextcloud.com>
336adbd to
f1c2797
Compare
Signed-off-by: Max <max@nextcloud.com>
Signed-off-by: Max <max@nextcloud.com>
The two used to be the same - but now we have contexts to store the file id. 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