1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Added debug info to detect empty note issue

This commit is contained in:
Laurent Cozic 2020-06-13 17:17:32 +01:00
parent 126918be54
commit 4aef72572d

View File

@ -87,6 +87,18 @@ const reduxSharedMiddleware = async function(store, next, action) {
items: await Tag.allWithNotes(),
});
}
// For debugging purposes: it seems in some case an empty note is saved to
// the note array, so in that case display a log statements so that it can
// be debugged.
// https://discourse.joplinapp.org/t/how-to-recover-corrupted-database/9367/3?u=laurent
if (action.type.indexOf('NOTE_') === 0) {
for (const note of newState.notes) {
if (!note) {
reg.logger().error('Detected empty element in note array', action);
}
}
}
};
module.exports = reduxSharedMiddleware;