hedgeagent/1.12.0 #1
@@ -1,4 +1,5 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
const util = require('util')
|
||||||
// realtime
|
// realtime
|
||||||
// external modules
|
// external modules
|
||||||
const cookie = require('cookie')
|
const cookie = require('cookie')
|
||||||
@@ -569,16 +570,13 @@ function disconnect (socket) {
|
|||||||
if (note.server.isDirty) {
|
if (note.server.isDirty) {
|
||||||
updateNote(note, function (err, _note) {
|
updateNote(note, function (err, _note) {
|
||||||
if (err) return logger.error('disconnect note failed: ' + err)
|
if (err) return logger.error('disconnect note failed: ' + err)
|
||||||
|
// Check again for online users before clear, because users could reconnect during the async updateNote
|
||||||
|
if (Object.keys(note.users).length <= 0) {
|
||||||
// clear server before delete to avoid memory leaks
|
// clear server before delete to avoid memory leaks
|
||||||
note.server.document = ''
|
note.server.document = ''
|
||||||
note.server.operations = []
|
note.server.operations = []
|
||||||
delete note.server
|
delete note.server
|
||||||
delete notes[noteId]
|
delete notes[noteId]
|
||||||
if (config.debug) {
|
|
||||||
logger.debug(notes)
|
|
||||||
getStatus(function (data) {
|
|
||||||
logger.debug(JSON.stringify(data))
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -596,7 +594,7 @@ function disconnect (socket) {
|
|||||||
if (disconnectSocketQueue.length > 0) { disconnect(disconnectSocketQueue[0]) }
|
if (disconnectSocketQueue.length > 0) { disconnect(disconnectSocketQueue[0]) }
|
||||||
|
|
||||||
if (config.debug) {
|
if (config.debug) {
|
||||||
logger.debug(notes)
|
logger.debug(util.inspect(notes))
|
||||||
getStatus(function (data) {
|
getStatus(function (data) {
|
||||||
logger.debug(JSON.stringify(data))
|
logger.debug(JSON.stringify(data))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
- All links will be opened in new tabs instead of the same tab as the note. This was changed when the external link warning was implemented and now the old behavior is restored.
|
- All links will be opened in new tabs instead of the same tab as the note. This was changed when the external link warning was implemented and now the old behavior is restored.
|
||||||
|
- Fixed a bug in the realtime disconnect handler that could lead to data-loss of users with a flaky connection
|
||||||
|
|
||||||
## <i class="fa fa-tag"></i> 1.11.1 <i class="fa fa-calendar-o"></i> 2026-07-24
|
## <i class="fa fa-tag"></i> 1.11.1 <i class="fa fa-calendar-o"></i> 2026-07-24
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user