Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
95764c6
chore(split): SaveService from SyncService
max-nextcloud Jul 1, 2025
2405e75
chore(type): sync service with typescript
max-nextcloud Jul 2, 2025
8525912
chore(migrate): sync service mixin to composable
max-nextcloud Jul 2, 2025
507a7a5
chore(refactor): watch sync service to create save service
max-nextcloud Jul 3, 2025
594fb1a
chore(refactor): move connectSyncService into useSyncService composable
max-nextcloud Jul 3, 2025
725872c
refactor(compose): migrate save service to composable
max-nextcloud Jul 3, 2025
9fdf878
refactor(editor): detect rich editor based on markdown extension
max-nextcloud Jul 3, 2025
94f7619
refactor(editor): always provide an editor
max-nextcloud Jul 3, 2025
e8d184a
refactor(cleanup): unwrap connection
max-nextcloud Jul 3, 2025
c856f2f
chore(minor): clean up redundant injects
max-nextcloud Jul 3, 2025
00c18c4
chore(refactor): simplify types for props
max-nextcloud Jul 3, 2025
c71503e
chore(refactor): watch sync service in useConnection
max-nextcloud Jul 5, 2025
7265f02
chore(extract): Mentions api from extension
max-nextcloud Jul 5, 2025
f6b76f3
chore(simplify): SyncService.open returns void
max-nextcloud Jul 5, 2025
90ae016
chore(simplify): combine loaded and opened event
max-nextcloud Jul 5, 2025
8a46d28
chore(cleanup): unused getter
max-nextcloud Jul 5, 2025
798c4b8
fix(menu): call base components setup function
max-nextcloud Jul 5, 2025
8b45a52
chore(refactor): connect from useConnection composable
max-nextcloud Jul 5, 2025
7bc34c9
chore(cleanup): sync and save service are always defined now
max-nextcloud Jul 6, 2025
d4a09c4
test(cy): properly close connections
max-nextcloud Jul 6, 2025
e6fc63b
chore(refactor): sync service with new connection
max-nextcloud Jul 7, 2025
c3230d3
chore(refactor): instantiate SessionConnection with plain data
max-nextcloud Jul 7, 2025
7dc8e25
fix(sync): stop autosave when closing connection
max-nextcloud Jul 8, 2025
7c52d1c
chore(cleanup): ? on attributes that are always truthy
max-nextcloud Jul 8, 2025
f370913
chore(cleanup): avoid reuse of isRichEditor name
max-nextcloud Jul 8, 2025
6c76f27
chore(cleanup): remove outdated comment
max-nextcloud Jul 8, 2025
9ea9857
chore(copyright): fix year to 2025
max-nextcloud Jul 8, 2025
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
Prev Previous commit
Next Next commit
chore(simplify): SyncService.open returns void
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Jul 7, 2025
commit f6b76f38aaee11c01733aaa862385f3a6ce8092a
8 changes: 3 additions & 5 deletions src/services/SyncService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ class SyncService {
}: {
fileId: number
initialSession: object
}) {
}): Promise<void> {
if (this.hasActiveConnection()) {
return this.connectionState
return
}
const connect = initialSession
? Promise.resolve(new Connection({ data: initialSession }, {}))
Expand All @@ -158,15 +158,13 @@ class SyncService {
this.connection = await connect
if (!this.connection) {
// Error was already emitted in connect
return null
return
}
this.backend = new PollingBackend(this, this.connection)
this.version = this.connection.docStateVersion
this.#baseVersionEtag = this.connection.document.baseVersionEtag
this.emit('opened', this.connectionState)
this.emit('loaded', this.connectionState)

return this.connectionState
}

startSync() {
Expand Down
2 changes: 1 addition & 1 deletion src/services/WebSocketPolyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function initWebSocketPolyfill(syncService, fileId, initialSessio
},
})

syncService.open({ fileId, initialSession }).then((data) => {
syncService.open({ fileId, initialSession }).then(() => {
if (syncService.hasActiveConnection) {
this.onopen?.()
}
Expand Down