Repository navigation
Conversation
|
@ShGKme thank you for this, I didn't test but it makes sense to me to fetch it again on close. I think the new Awaiting it there could fix it but |
Ah, yes, I see. Something like: async close() {
const activeConnection = this.connection.value
this.backend?.disconnect()
// Clear connection immediately so hasActiveConnection turns false and we can reconnect.
this.connection.value = undefined
this.bus.emit('close')
if (activeConnection) {
await close(activeConnection)
// Log and ignore possible network issues.
.catch((e) => {
logger.info('Failed to close connection.', { e })
})
}
} |
max-nextcloud
left a comment
There was a problem hiding this comment.
Hi Grigorii,
Thanks a lot for looking into this. Your fix looks good with the addition you proposed in the comment.
Shall I apply the proposed change and take this over (i.e. merge and backport)?
|
Added a |
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
3f25b4f to
43ebb2a
Compare
|
Rebased onto main and squashed |
|
Cypress fail seems unrelated. |
|
Ah, no, the same problem in other PRs. |
|
/backport to stable35 please |
|
/backport to stable34 please |
|
/backport to stable33 please |
|
/backport to stable32 please |
|
/backport to stable31 please |
馃摑 Summary
Caused by:
text/src/components/CollaborativeEditor.vue
Lines 768 to 773 in a3daf37
fetchFilefetches the locked file, stored later inthis.fileNodesizeandmtime...size/mtime, Files also receivesattributes.lock = 1From my understanding, the Text frontend doesn't actually know if the file is locked or not after the file is saved and the session connection is closed.
/closeendpoint may and may not unlock the file.Instead of changing the
lockand other properties locally, we can fetch the actual updated node state.This way we have all the properties and attributes updated.
This, unfortunately, adds one more request.
I added it to the close method instead of
onSave.onSave's cheap (no-request) update is kept for a case when the file is edited in the folder description (README.md). Only on viewer closed when the session is actually closed the file is updated in Files app completely.This may result in flickering for a second on close:
onSaveclose().IMO, we can:
onSavecompletely (but then there is no visual update on README from description)What fo you think?
Additionally,
SyncService.closemethod is slightly refactored, to the returned promise is resolved after the request finishes, not on just sent. Local state and even is still sync.馃弫 Checklist
npm run lint/npm run stylelint/composer run cs:check)馃 AI (if applicable)