Repository navigation
Conversation
Signed-off-by: Grigorii K. Shartsev <[email protected]>
|
@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 })
})
}
} |
馃摑 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?
馃弫 Checklist
npm run lint/npm run stylelint/composer run cs:check)馃 AI (if applicable)