Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
8daa7fe
chore(cleanup): error handling
max-nextcloud Aug 18, 2026
7ee91ff
chore(refactor): Introduce IContext and FileContext
max-nextcloud Aug 12, 2026
9453895
chore(refactor): simplify IContext API with helper classes
max-nextcloud Aug 15, 2026
f4ce862
chore(refactor): very basic registry for context factories
max-nextcloud Aug 15, 2026
a6e18c5
chore(refactor): handle baseVersionEtag outside IContext
max-nextcloud Aug 15, 2026
7301d64
chore(refactor): introduce RegisterContextEvent
max-nextcloud Aug 16, 2026
49b0ee5
chore(refactor): split open api functions
max-nextcloud Aug 16, 2026
166a0e1
enh(api): allow opening contexts of different types
max-nextcloud Aug 17, 2026
86f01d8
enh(db): add context to document
max-nextcloud Aug 18, 2026
9f0561c
chore(version): bump to run migration
max-nextcloud Aug 18, 2026
fab5576
chore(refactor): store outside change in the DocumentSaveConflictExce…
max-nextcloud Aug 18, 2026
7d57721
enh(api): handle sync requests with context
max-nextcloud Aug 18, 2026
7684e23
fix(attachments): get file via context
max-nextcloud Aug 18, 2026
ebd994f
fix(share): consider share token in ContextManager
max-nextcloud Aug 19, 2026
6e4363f
fix(push): use context to check if file is readonly
max-nextcloud Aug 19, 2026
5271b92
enh(save): use context for saving
max-nextcloud Aug 19, 2026
7fd674f
chore(cleanup): redundant check for lock provider
max-nextcloud Aug 19, 2026
6abf501
chore(tweak): return first editable file early
max-nextcloud Aug 19, 2026
8353616
fix(session): also consider `shareToken` parameter as used by Attachm…
max-nextcloud Aug 19, 2026
db5a34a
fix(middleware): get fileId from context rather than documentId
max-nextcloud Aug 19, 2026
31bb6d3
fix(share): get file from context for attachments
max-nextcloud Aug 19, 2026
5ff801e
fix(migration): migrate old document rows to new format
max-nextcloud Aug 19, 2026
c517c8a
fix(db): migrations adding context type and id
max-nextcloud Aug 20, 2026
2665520
fix(api): Unlock the file via the context
max-nextcloud Aug 20, 2026
60f55db
fix(api): use context to load document
max-nextcloud Aug 20, 2026
9f33529
chore(perf): add documents index for context
max-nextcloud Aug 20, 2026
23e7c99
chore(refactor): migrate PublicFilesEditor to script setup and ts
max-nextcloud Aug 20, 2026
ffccbe7
chore(refactor): ViewerComponent to script setup and ts
max-nextcloud Aug 20, 2026
c56c3a6
chore(cleanup): unused PublicFilesEditor
max-nextcloud Aug 20, 2026
27f0128
enh(OCA.text): accept context in CreateCollaborativeEditor
max-nextcloud Aug 20, 2026
06a8721
chore(tests): adjust some cypress tests to contexts
max-nextcloud Aug 21, 2026
e092667
fix(hooks): resetDocument gets a fileId use it as such
max-nextcloud Aug 22, 2026
cd911c5
chore(refactor): hand the user to the fileContextFactory
max-nextcloud Aug 23, 2026
a676800
chore(refactor): register Context Factory instead of callable
max-nextcloud Aug 23, 2026
8a7717c
chore(types): introduce IContextFactory
max-nextcloud Aug 23, 2026
a1674f7
chore(refactor): make FileContext lazy load file
max-nextcloud Aug 23, 2026
09668d0
fix(document): get document via context in NodeWritten listener.
max-nextcloud Aug 24, 2026
379ec9a
fix(document): get document via context to update version info
max-nextcloud Aug 24, 2026
f110943
fix(attachment): use proper document id - not $textFile->getId
max-nextcloud Aug 24, 2026
aa1c6b3
fix(props): use context instead of fileId
max-nextcloud Aug 25, 2026
82ec0c2
fix(attachments): use User and Share from controller
max-nextcloud Aug 25, 2026
0967e36
fix(api): Respond to missing file with 404
max-nextcloud Sep 1, 2026
d1dc2a3
chore(test): adjust cypress attachment spec
max-nextcloud Sep 1, 2026
9f7028d
fix(viewer): bring back autofocus by default
max-nextcloud Sep 2, 2026
cbaf9ba
fix(types): declare strict types on new classes
max-nextcloud Sep 2, 2026
376c7c0
chore(refactor): split classes in their own files
max-nextcloud Sep 2, 2026
3c59d11
fix(api): remove inactive sessions when creating new one
max-nextcloud Sep 2, 2026
5d79611
chore(refactor): update document without conflict exception in IContext
max-nextcloud Sep 2, 2026
bbfa64d
enh(events): DocumentContentUpdated Event to clear editing session
max-nextcloud Sep 2, 2026
e44d1a1
chore(split): unlocking the file from resetDocument
max-nextcloud Sep 2, 2026
d0fc4be
fix(context): do not return document from updateDocument
max-nextcloud Sep 3, 2026
1d762b0
Avoid log spam on non-existing keys
max-nextcloud Sep 3, 2026
f113596
fix(db): make text_documents_context_index unique
max-nextcloud Sep 3, 2026
45e22e7
fix(document): load by context on unique constraint error
max-nextcloud Sep 3, 2026
ec79529
chore(cleanup): unused $shareToken
max-nextcloud Sep 3, 2026
7908c72
fix(api): use file id in public session api
max-nextcloud Sep 3, 2026
c2274ae
fix(attachments): Handle document DoesNotExistException
max-nextcloud Sep 3, 2026
e31d79e
fix(types): provide context to autofocus extension
max-nextcloud Sep 3, 2026
b63c951
fix(mention): use actual file id
max-nextcloud Sep 7, 2026
bd8567d
fix(images): update image when src changes
max-nextcloud Sep 7, 2026
d856571
chore(update): use addType with Types:: constants
max-nextcloud Sep 7, 2026
d93af32
chore(playwright): put synchronize content specs in one folder
max-nextcloud Sep 28, 2026
89eefba
chore(tests): adjust create session url in playwright
max-nextcloud Sep 28, 2026
5500359
fix(viewer): always autofocus
max-nextcloud Sep 28, 2026
9518a94
chore(test): adjust cypress routes to new create route
max-nextcloud Sep 29, 2026
84c5780
enh(document): use snowflake ids
max-nextcloud Sep 7, 2026
5a82a7e
fix(cron): cleanup attachments by file id not document id
max-nextcloud Sep 9, 2026
499bc8a
fix(db): remove autoincrement from documents migration
max-nextcloud Sep 9, 2026
ef22eb1
fix(occ): ResetDocument with file id from context
max-nextcloud Sep 9, 2026
bcc4403
chore(refactor): move types used everywhere into types directory
max-nextcloud Sep 9, 2026
16d7ded
chore(types): document id is now a string
max-nextcloud Sep 9, 2026
c5c1665
fix(AttachmentResolver): always provide documentId as documentId, not…
blizzz Sep 9, 2026
d00fabc
chore(attachments): get list for files without session
max-nextcloud Sep 10, 2026
5732adc
chore(lint): remove duplicate empty lines
max-nextcloud Sep 10, 2026
ae0c08d
fix(attachments): handle missing document / invalid file id
max-nextcloud Sep 10, 2026
12c3232
fix(attachments): get context either from session or with fileId
max-nextcloud Sep 10, 2026
d8583cc
chore(test): attachments dir uses fileId not documentId
max-nextcloud Sep 30, 2026
8ec8881
chore(test): store file names grouped by dirname
max-nextcloud Sep 30, 2026
9f7f071
fix(occ): use fileId, not in occ text:reset
max-nextcloud Sep 30, 2026
fee60a3
fix(occ): reset session for corner cases
max-nextcloud Sep 30, 2026
fd83212
fix(attachments): assertUserOrShareToken without documentId
max-nextcloud Sep 30, 2026
26569d6
fix(upload): check for write permission on text file
max-nextcloud Sep 30, 2026
c9da94d
chore: remove redundant `return` and fix indention of comment
mejo- Sep 30, 2026
2c3011f
refactor(backend): share one download-disabled check
mejo- Sep 30, 2026
cbebd98
fix(save): update document etag and timestamp
max-nextcloud Sep 30, 2026
a857ab2
chore(rename): hasOwner -> canAttachFiles
max-nextcloud Sep 30, 2026
8181242
fix(api): cleanup and document IContext
max-nextcloud Sep 30, 2026
fd5d753
chore(rename): openFile -> openContext
max-nextcloud Sep 30, 2026
ff18e64
chore(migration): remove unused dependency injection
mejo- Sep 30, 2026
13dc2c1
chore(frontend): fix stale "fileId" wordings
mejo- Sep 30, 2026
2309301
fix(migration): drop UPDATE table alias unsupported by SQLite
mejo- Sep 30, 2026
22aea5a
fix(listeners): catch errors DocumentContentUpdatedListener can hit
mejo- Sep 30, 2026
4a5f466
chore(listeners): stop listening to BeforeNodeWrittenEvent
mejo- Sep 30, 2026
0a84ab4
chore(migration): declare context index as unique
mejo- Sep 30, 2026
f378142
fix(listeners): keep lock when version restore reset is refused
mejo- Sep 30, 2026
ea58072
fix(cron): only clean up attachments for file contexts
mejo- Sep 30, 2026
1a72162
fix(context): refuse share access to non-file contexts
mejo- Sep 30, 2026
ec54f2c
fix(editor): pass context explicitly in EditorReloader
mejo- Sep 30, 2026
2b03135
chore(lint): use `vue-tsc` instead of pure `tsc`
mejo- Sep 30, 2026
b463608
fix(listeners): keep Text's lock on its own saves
mejo- Sep 30, 2026
084a127
fix(session): answer 404/403 instead of 500 for lost access
mejo- Sep 30, 2026
d84a634
fix(autosave): do not overwrite outside changes that cannot be loaded
mejo- Sep 30, 2026
842575e
fix(viewer): make active and isEmbedded props optional
mejo- Sep 30, 2026
8fa5e07
fix(files): always update checksum
max-nextcloud Oct 4, 2026
7f12bf9
chore(cleanup): avoid setting the checksum twice
max-nextcloud Oct 4, 2026
6209d90
chore(ci): debug log text
max-nextcloud Oct 3, 2026
306bb05
chore(log): debug updateDocument
max-nextcloud Oct 4, 2026
08fceff
fix(file): always update checksum in event handler
max-nextcloud Oct 5, 2026
1178c01
chore(cleanup): updateDocument in file contexts
max-nextcloud Oct 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/cypress-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ jobs:
PHP_CLI_SERVER_WORKERS: 10
run: |
mkdir data
echo '<?php $CONFIG=["memcache.local"=>"\OC\Memcache\APCu","hashing_default_password"=>true];' > config/config.php
echo '<?php $CONFIG=[' > config/config.php
echo '"memcache.local"=>"\OC\Memcache\APCu",' >> config/config.php
echo '"hashing_default_password"=>true,' >> config/config.php
echo '"log.condition"=>["apps"=>["text"]]' >> config/config.php
echo '];' >> config/config.php
php occ maintenance:install --verbose --database=pgsql --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f index.php
php -S 0.0.0.0:8081 &
Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- **💾 Open format:** Files are saved as [Markdown](https://en.wikipedia.org/wiki/Markdown), so you can edit them from any other text app too.
- **✊ Strong foundation:** We use [🐈 tiptap](https://tiptap.scrumpy.io) which is based on [🦉 ProseMirror](https://prosemirror.net) – huge thanks to them!
]]></description>
<version>10.0.0-dev.0</version>
<version>10.0.0-dev.1</version>
<licence>agpl</licence>
<author mail="jus@bitgrid.net">Julius Härtl</author>
<namespace>Text</namespace>
Expand Down
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
['name' => 'Attachment#getMediaFilePreview', 'url' => '/mediaPreview', 'verb' => 'GET'],

/** @see Controller\SessionController::create() */
['name' => 'Session#create', 'url' => '/session/{documentId}/create', 'verb' => 'PUT'],
['name' => 'Session#create', 'url' => '/session/{type}/{id}/create', 'verb' => 'PUT'],
/** @see Controller\SessionController::save() */
['name' => 'Session#save', 'url' => '/session/{documentId}/save', 'verb' => 'POST'],
/** @see Controller\SessionController::sync() */
Expand Down
16 changes: 16 additions & 0 deletions composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@
'OCA\\Text\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
'OCA\\Text\\Command\\ResetDocument' => $baseDir . '/../lib/Command/ResetDocument.php',
'OCA\\Text\\ConfigLexicon' => $baseDir . '/../lib/ConfigLexicon.php',
'OCA\\Text\\Context\\ContextManager' => $baseDir . '/../lib/Context/ContextManager.php',
'OCA\\Text\\Context\\DocumentData' => $baseDir . '/../lib/Context/DocumentData.php',
'OCA\\Text\\Context\\FileContext' => $baseDir . '/../lib/Context/FileContext.php',
'OCA\\Text\\Context\\FileContextFactory' => $baseDir . '/../lib/Context/FileContextFactory.php',
'OCA\\Text\\Context\\IContext' => $baseDir . '/../lib/Context/IContext.php',
'OCA\\Text\\Context\\IContextFactory' => $baseDir . '/../lib/Context/IContextFactory.php',
'OCA\\Text\\Context\\NewSessionData' => $baseDir . '/../lib/Context/NewSessionData.php',
'OCA\\Text\\Context\\SessionInfo' => $baseDir . '/../lib/Context/SessionInfo.php',
'OCA\\Text\\Context\\UnauthorizedFileContext' => $baseDir . '/../lib/Context/UnauthorizedFileContext.php',
'OCA\\Text\\Controller\\AiController' => $baseDir . '/../lib/Controller/AiController.php',
'OCA\\Text\\Controller\\AttachmentController' => $baseDir . '/../lib/Controller/AttachmentController.php',
'OCA\\Text\\Controller\\ISessionAwareController' => $baseDir . '/../lib/Controller/ISessionAwareController.php',
Expand All @@ -30,8 +39,10 @@
'OCA\\Text\\Db\\StepMapper' => $baseDir . '/../lib/Db/StepMapper.php',
'OCA\\Text\\DirectEditing\\TextDirectEditor' => $baseDir . '/../lib/DirectEditing/TextDirectEditor.php',
'OCA\\Text\\DirectEditing\\TextDocumentCreator' => $baseDir . '/../lib/DirectEditing/TextDocumentCreator.php',
'OCA\\Text\\Event\\DocumentContentUpdated' => $baseDir . '/../lib/Event/DocumentContentUpdated.php',
'OCA\\Text\\Event\\LoadEditor' => $baseDir . '/../lib/Event/LoadEditor.php',
'OCA\\Text\\Event\\MentionEvent' => $baseDir . '/../lib/Event/MentionEvent.php',
'OCA\\Text\\Event\\RegisterContextEvent' => $baseDir . '/../lib/Event/RegisterContextEvent.php',
'OCA\\Text\\Exception\\AccountDisabledException' => $baseDir . '/../lib/Exception/AccountDisabledException.php',
'OCA\\Text\\Exception\\DocumentHasUnsavedChangesException' => $baseDir . '/../lib/Exception/DocumentHasUnsavedChangesException.php',
'OCA\\Text\\Exception\\DocumentSaveConflictException' => $baseDir . '/../lib/Exception/DocumentSaveConflictException.php',
Expand All @@ -43,12 +54,14 @@
'OCA\\Text\\Listeners\\BeforeAssistantNotificationListener' => $baseDir . '/../lib/Listeners/BeforeAssistantNotificationListener.php',
'OCA\\Text\\Listeners\\BeforeNodeDeletedListener' => $baseDir . '/../lib/Listeners/BeforeNodeDeletedListener.php',
'OCA\\Text\\Listeners\\BeforeNodeRenamedListener' => $baseDir . '/../lib/Listeners/BeforeNodeRenamedListener.php',
'OCA\\Text\\Listeners\\DocumentContentUpdatedListener' => $baseDir . '/../lib/Listeners/DocumentContentUpdatedListener.php',
'OCA\\Text\\Listeners\\FilesLoadAdditionalScriptsListener' => $baseDir . '/../lib/Listeners/FilesLoadAdditionalScriptsListener.php',
'OCA\\Text\\Listeners\\FilesSharingLoadAdditionalScriptsListener' => $baseDir . '/../lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php',
'OCA\\Text\\Listeners\\LoadEditorListener' => $baseDir . '/../lib/Listeners/LoadEditorListener.php',
'OCA\\Text\\Listeners\\LoadViewerListener' => $baseDir . '/../lib/Listeners/LoadViewerListener.php',
'OCA\\Text\\Listeners\\NodeCopiedListener' => $baseDir . '/../lib/Listeners/NodeCopiedListener.php',
'OCA\\Text\\Listeners\\NodeWrittenResetDocumentListener' => $baseDir . '/../lib/Listeners/NodeWrittenResetDocumentListener.php',
'OCA\\Text\\Listeners\\RegisterContextEventListener' => $baseDir . '/../lib/Listeners/RegisterContextEventListener.php',
'OCA\\Text\\Listeners\\RegisterDirectEditorEventListener' => $baseDir . '/../lib/Listeners/RegisterDirectEditorEventListener.php',
'OCA\\Text\\Listeners\\RegisterTemplateCreatorListener' => $baseDir . '/../lib/Listeners/RegisterTemplateCreatorListener.php',
'OCA\\Text\\Listeners\\VersionRestoredListener' => $baseDir . '/../lib/Listeners/VersionRestoredListener.php',
Expand All @@ -67,6 +80,9 @@
'OCA\\Text\\Migration\\Version040100Date20240611165300' => $baseDir . '/../lib/Migration/Version040100Date20240611165300.php',
'OCA\\Text\\Migration\\Version070000Date20250925110024' => $baseDir . '/../lib/Migration/Version070000Date20250925110024.php',
'OCA\\Text\\Migration\\Version080000Date20260331132113' => $baseDir . '/../lib/Migration/Version080000Date20260331132113.php',
'OCA\\Text\\Migration\\Version090000Date20260817110024' => $baseDir . '/../lib/Migration/Version090000Date20260817110024.php',
'OCA\\Text\\Migration\\Version090000Date20260819110024' => $baseDir . '/../lib/Migration/Version090000Date20260819110024.php',
'OCA\\Text\\Migration\\Version090000Date20260820132113' => $baseDir . '/../lib/Migration/Version090000Date20260820132113.php',
'OCA\\Text\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
'OCA\\Text\\Service\\AiTagService' => $baseDir . '/../lib/Service/AiTagService.php',
'OCA\\Text\\Service\\ApiService' => $baseDir . '/../lib/Service/ApiService.php',
Expand Down
16 changes: 16 additions & 0 deletions composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ class ComposerStaticInitText
'OCA\\Text\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
'OCA\\Text\\Command\\ResetDocument' => __DIR__ . '/..' . '/../lib/Command/ResetDocument.php',
'OCA\\Text\\ConfigLexicon' => __DIR__ . '/..' . '/../lib/ConfigLexicon.php',
'OCA\\Text\\Context\\ContextManager' => __DIR__ . '/..' . '/../lib/Context/ContextManager.php',
'OCA\\Text\\Context\\DocumentData' => __DIR__ . '/..' . '/../lib/Context/DocumentData.php',
'OCA\\Text\\Context\\FileContext' => __DIR__ . '/..' . '/../lib/Context/FileContext.php',
'OCA\\Text\\Context\\FileContextFactory' => __DIR__ . '/..' . '/../lib/Context/FileContextFactory.php',
'OCA\\Text\\Context\\IContext' => __DIR__ . '/..' . '/../lib/Context/IContext.php',
'OCA\\Text\\Context\\IContextFactory' => __DIR__ . '/..' . '/../lib/Context/IContextFactory.php',
'OCA\\Text\\Context\\NewSessionData' => __DIR__ . '/..' . '/../lib/Context/NewSessionData.php',
'OCA\\Text\\Context\\SessionInfo' => __DIR__ . '/..' . '/../lib/Context/SessionInfo.php',
'OCA\\Text\\Context\\UnauthorizedFileContext' => __DIR__ . '/..' . '/../lib/Context/UnauthorizedFileContext.php',
'OCA\\Text\\Controller\\AiController' => __DIR__ . '/..' . '/../lib/Controller/AiController.php',
'OCA\\Text\\Controller\\AttachmentController' => __DIR__ . '/..' . '/../lib/Controller/AttachmentController.php',
'OCA\\Text\\Controller\\ISessionAwareController' => __DIR__ . '/..' . '/../lib/Controller/ISessionAwareController.php',
Expand All @@ -45,8 +54,10 @@ class ComposerStaticInitText
'OCA\\Text\\Db\\StepMapper' => __DIR__ . '/..' . '/../lib/Db/StepMapper.php',
'OCA\\Text\\DirectEditing\\TextDirectEditor' => __DIR__ . '/..' . '/../lib/DirectEditing/TextDirectEditor.php',
'OCA\\Text\\DirectEditing\\TextDocumentCreator' => __DIR__ . '/..' . '/../lib/DirectEditing/TextDocumentCreator.php',
'OCA\\Text\\Event\\DocumentContentUpdated' => __DIR__ . '/..' . '/../lib/Event/DocumentContentUpdated.php',
'OCA\\Text\\Event\\LoadEditor' => __DIR__ . '/..' . '/../lib/Event/LoadEditor.php',
'OCA\\Text\\Event\\MentionEvent' => __DIR__ . '/..' . '/../lib/Event/MentionEvent.php',
'OCA\\Text\\Event\\RegisterContextEvent' => __DIR__ . '/..' . '/../lib/Event/RegisterContextEvent.php',
'OCA\\Text\\Exception\\AccountDisabledException' => __DIR__ . '/..' . '/../lib/Exception/AccountDisabledException.php',
'OCA\\Text\\Exception\\DocumentHasUnsavedChangesException' => __DIR__ . '/..' . '/../lib/Exception/DocumentHasUnsavedChangesException.php',
'OCA\\Text\\Exception\\DocumentSaveConflictException' => __DIR__ . '/..' . '/../lib/Exception/DocumentSaveConflictException.php',
Expand All @@ -58,12 +69,14 @@ class ComposerStaticInitText
'OCA\\Text\\Listeners\\BeforeAssistantNotificationListener' => __DIR__ . '/..' . '/../lib/Listeners/BeforeAssistantNotificationListener.php',
'OCA\\Text\\Listeners\\BeforeNodeDeletedListener' => __DIR__ . '/..' . '/../lib/Listeners/BeforeNodeDeletedListener.php',
'OCA\\Text\\Listeners\\BeforeNodeRenamedListener' => __DIR__ . '/..' . '/../lib/Listeners/BeforeNodeRenamedListener.php',
'OCA\\Text\\Listeners\\DocumentContentUpdatedListener' => __DIR__ . '/..' . '/../lib/Listeners/DocumentContentUpdatedListener.php',
'OCA\\Text\\Listeners\\FilesLoadAdditionalScriptsListener' => __DIR__ . '/..' . '/../lib/Listeners/FilesLoadAdditionalScriptsListener.php',
'OCA\\Text\\Listeners\\FilesSharingLoadAdditionalScriptsListener' => __DIR__ . '/..' . '/../lib/Listeners/FilesSharingLoadAdditionalScriptsListener.php',
'OCA\\Text\\Listeners\\LoadEditorListener' => __DIR__ . '/..' . '/../lib/Listeners/LoadEditorListener.php',
'OCA\\Text\\Listeners\\LoadViewerListener' => __DIR__ . '/..' . '/../lib/Listeners/LoadViewerListener.php',
'OCA\\Text\\Listeners\\NodeCopiedListener' => __DIR__ . '/..' . '/../lib/Listeners/NodeCopiedListener.php',
'OCA\\Text\\Listeners\\NodeWrittenResetDocumentListener' => __DIR__ . '/..' . '/../lib/Listeners/NodeWrittenResetDocumentListener.php',
'OCA\\Text\\Listeners\\RegisterContextEventListener' => __DIR__ . '/..' . '/../lib/Listeners/RegisterContextEventListener.php',
'OCA\\Text\\Listeners\\RegisterDirectEditorEventListener' => __DIR__ . '/..' . '/../lib/Listeners/RegisterDirectEditorEventListener.php',
'OCA\\Text\\Listeners\\RegisterTemplateCreatorListener' => __DIR__ . '/..' . '/../lib/Listeners/RegisterTemplateCreatorListener.php',
'OCA\\Text\\Listeners\\VersionRestoredListener' => __DIR__ . '/..' . '/../lib/Listeners/VersionRestoredListener.php',
Expand All @@ -82,6 +95,9 @@ class ComposerStaticInitText
'OCA\\Text\\Migration\\Version040100Date20240611165300' => __DIR__ . '/..' . '/../lib/Migration/Version040100Date20240611165300.php',
'OCA\\Text\\Migration\\Version070000Date20250925110024' => __DIR__ . '/..' . '/../lib/Migration/Version070000Date20250925110024.php',
'OCA\\Text\\Migration\\Version080000Date20260331132113' => __DIR__ . '/..' . '/../lib/Migration/Version080000Date20260331132113.php',
'OCA\\Text\\Migration\\Version090000Date20260817110024' => __DIR__ . '/..' . '/../lib/Migration/Version090000Date20260817110024.php',
'OCA\\Text\\Migration\\Version090000Date20260819110024' => __DIR__ . '/..' . '/../lib/Migration/Version090000Date20260819110024.php',
'OCA\\Text\\Migration\\Version090000Date20260820132113' => __DIR__ . '/..' . '/../lib/Migration/Version090000Date20260820132113.php',
'OCA\\Text\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
'OCA\\Text\\Service\\AiTagService' => __DIR__ . '/..' . '/../lib/Service/AiTagService.php',
'OCA\\Text\\Service\\ApiService' => __DIR__ . '/..' . '/../lib/Service/ApiService.php',
Expand Down
34 changes: 18 additions & 16 deletions cypress/e2e/api/SessionApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ describe('The session Api', function() {
})

it('returns connection', function() {
cy.openConnection({ fileId }).then(({ connection }) => {
cy.wrap(connection).its('documentId').should('equal', fileId)
cy.openFileConnection({ fileId }).then(({ connection }) => {
cy.wrap(connection)
.its('documentId')
.then((id) => Number.parseInt(id))
.should('be.greaterThan', 1_000_000) // snowflake ids have more than 20 bit.
cy.closeConnection(connection)
})
})

it('provides initial content', function() {
cy.openConnection({ fileId, filePath }).then(({ connection, data }) => {
cy.openFileConnection({ fileId, filePath }).then(({ connection, data }) => {
cy.wrap(data).its('content').should('eql', '## Hello world\n')
cy.closeConnection(connection)
})
Expand All @@ -54,7 +57,7 @@ describe('The session Api', function() {
})

it('handles missing file id', function() {
cy.failToCreateTextSession().its('status').should('equal', 412)
cy.failToCreateTextSession().its('status').should('equal', 404)
})
})

Expand All @@ -63,7 +66,7 @@ describe('The session Api', function() {

beforeEach(function() {
cy.uploadTestFile()
.then((fileId) => cy.openConnection({ fileId }))
.then((fileId) => cy.openFileConnection({ fileId }))
.then(({ connection: con }) => {
connection = con
})
Expand Down Expand Up @@ -116,7 +119,7 @@ describe('The session Api', function() {
cy.uploadTestFile()
.then((id) => {
fileId = id
return cy.openConnection({ fileId, filePath })
return cy.openFileConnection({ fileId, filePath })
})
.then(({ connection: con }) => {
connection = con
Expand Down Expand Up @@ -151,7 +154,7 @@ describe('The session Api', function() {
documentState,
manualSave: true,
})
cy.openConnection({ fileId, filePath })
cy.openFileConnection({ fileId, filePath })
.as('joining')
.its('data.documentState')
.should('eql', documentState)
Expand Down Expand Up @@ -183,7 +186,7 @@ describe('The session Api', function() {
.then(() => cy.clearCookies())
.then(() => {
return cy
.openConnection({ filePath: '', token: shareToken })
.openShareConnection({ filePath: '', token: shareToken })
.then(({ connection: con }) => {
connection = con
})
Expand Down Expand Up @@ -223,7 +226,7 @@ describe('The session Api', function() {
documentState,
manualSave: true,
})
cy.openConnection({ filePath: '', token: shareToken })
cy.openShareConnection({ filePath: '', token: shareToken })
.as('joining')
.its('data.documentState')
.should('eql', documentState)
Expand All @@ -247,15 +250,15 @@ describe('The session Api', function() {
cy.log(token)
shareToken = token
cy.clearCookies()
cy.openConnection({ filePath: '', token: shareToken }).then(({ connection: con }) => {
cy.openShareConnection({ filePath: '', token: shareToken }).then(({ connection: con }) => {
connection = con
})
})
})

it('does not send initial content if other session is alive but did not push any steps', function() {
let joining
cy.openConnection({ filePath: '', token: shareToken })
cy.openShareConnection({ filePath: '', token: shareToken })
.then(({ connection: con, data }) => {
joining = con
return data
Expand All @@ -271,7 +274,7 @@ describe('The session Api', function() {
cy.pushSteps({ connection, steps: [messages.update], version })
.its('version')
.should('eql', 0)
cy.openConnection({ filePath: '', token: shareToken })
cy.openShareConnection({ filePath: '', token: shareToken })
.then(({ connection: con, data }) => {
joining = con
return data
Expand All @@ -283,9 +286,8 @@ describe('The session Api', function() {
})

it('refuses create,push,sync,save with non-matching baseVersionEtag', function() {
cy.failToCreateTextSession(undefined, 'wrongBaseVersionEtag', {
cy.failToCreateTextShareSession(shareToken, 'wrongBaseVersionEtag', {
filePath: '',
token: shareToken,
})
.its('status')
.should('eql', 412)
Expand All @@ -312,7 +314,7 @@ describe('The session Api', function() {
.its('version')
.should('eql', 0)
cy.log('Other user creates session')
cy.openConnection({ filePath: '', token: shareToken }).then(({ connection: con }) => {
cy.openShareConnection({ filePath: '', token: shareToken }).then(({ connection: con }) => {
joining = con
})
cy.log('Initial user closes session')
Expand All @@ -330,7 +332,7 @@ describe('The session Api', function() {
// Skipped for now since the behaviour chanced by not cleaning up the state on close/create
it.skip('ignores steps stored after close cleaned up', function() {
cy.pushAndClose({ connection, steps: [messages.update], version })
cy.openConnection({ filePath: '', token: shareToken })
cy.openShareConnection({ filePath: '', token: shareToken })
.then(({ connection: con, data }) => {
connection = con
return data
Expand Down
8 changes: 3 additions & 5 deletions cypress/e2e/api/SyncServiceProvider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe('Sync service provider', function() {
* @param {object} ydoc Yjs document
*/
function createProvider(ydoc) {
const context = { type: 'file', id: fileId }
const relativePath = '.'
let baseVersionEtag
const setBaseVersionEtag = (val) => {
Expand All @@ -50,21 +51,18 @@ describe('Sync service provider', function() {
const getBaseVersionEtag = () => baseVersionEtag
const { connection, openConnection } = provideConnection(
{
fileId,
context,
relativePath,
},
getBaseVersionEtag,
setBaseVersionEtag,
)
const { syncService } = provideSyncService(connection, openConnection)
const queue = []
syncService.bus.on('opened', () => syncService.startSync())
return createSyncServiceProvider({
ydoc,
syncService,
fileId,
initialSession: null,
queue,
context,
disableBc: true,
})
}
Expand Down
7 changes: 5 additions & 2 deletions cypress/e2e/api/UsersApi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ describe('The user mention API', function() {
cy.login(user)
cy.uploadTestFile('test.md')
.as('fileId')
.then((fileId) => cy.openConnection({ fileId }))
.then((fileId) => cy.openFileConnection({ fileId }))
.its('connection')
.as('connection')
})

it('has a valid connection', function() {
cy.get('@connection').its('documentId').should('equal', this.fileId)
cy.get('@connection')
.its('documentId')
.then((id) => Number.parseInt(id))
.should('be.greaterThan', 1_000_000) // snowflake ids have more than 20 bit.
cy.closeConnection(this.connection)
})

Expand Down
Loading
Loading