Problem
While composing a new email on Android, if you switch to another app (e.g. to reply to a notification or browse the web), Android can silently kill the Twake Mail process in the background to free up
memory. When you tap the Twake Mail icon again, the app restarts from scratch and the email you were writing is gone.
Root cause
The composer has no automatic draft saving on mobile. Content only survives if the user explicitly taps "Save draft" or closes the composer and confirms the save dialog. There is no AppLifecycleState
listener in the composer — so when Android terminates the process, the in-memory draft is lost with no recovery. (The web version already handles this via session storage on browser unload, but nothing
equivalent exists for Android/iOS.)
Fix
Add an AppLifecycleListener in ComposerController that triggers an automatic draft save when the app transitions to paused state. This ensures the draft is persisted to the server before the process is
potentially killed, and the user can resume from the Drafts folder.
Problem
While composing a new email on Android, if you switch to another app (e.g. to reply to a notification or browse the web), Android can silently kill the Twake Mail process in the background to free up
memory. When you tap the Twake Mail icon again, the app restarts from scratch and the email you were writing is gone.
Root cause
The composer has no automatic draft saving on mobile. Content only survives if the user explicitly taps "Save draft" or closes the composer and confirms the save dialog. There is no AppLifecycleState
listener in the composer — so when Android terminates the process, the in-memory draft is lost with no recovery. (The web version already handles this via session storage on browser unload, but nothing
equivalent exists for Android/iOS.)
Fix
Add an AppLifecycleListener in ComposerController that triggers an automatic draft save when the app transitions to paused state. This ensures the draft is persisted to the server before the process is
potentially killed, and the user can resume from the Drafts folder.