Skip to content

Save notes when the session manager stops the application - #177

Open
lucastanure wants to merge 1 commit into
linuxmint:masterfrom
lucastanure:master
Open

lucastanure wants to merge 1 commit into
linuxmint:masterfrom
lucastanure:master

Conversation

@lucastanure

Copy link
Copy Markdown

Text typed into a note reaches the disk only after two chained timers: one second after the last keystroke, then three more seconds before the file is written. At logout or shutdown the session manager stops the application with SIGTERM. The process has no handler for it and dies at once, so pending timers never run and the last seconds of typing are lost. A short note written just before shutting down comes back empty after the next login.

Moving or resizing a note inside that one-second window also cleared the pending "text changed" flag, so even a save that did happen could write the old text.

Text typed into a note reaches the disk only after two chained timers:
one second after the last keystroke, then three more seconds before the
file is written. At logout or shutdown the session manager stops the
application with SIGTERM. The process has no handler for it and dies at
once, so pending timers never run and the last seconds of typing are
lost. A short note written just before shutting down comes back empty
after the next login.

Moving or resizing a note inside that one-second window also cleared
the pending "text changed" flag, so even a save that did happen could
write the old text.

Signed-off-by: Lucas Tanure <tanure@linux.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant