We used sessionStorage because we wanted to ensure the autosaved changes won't pile up forever, and a guarantee that it will be deleted when the "session" ends was very convenient (saves us code for cleaning up expired entries, and defining when they even should expire, etc.).
But it seems that sessionStorage data is deleted in several cases where autosave would be very convenient:
- Mobile browsers unloading the page (T217783)
- Machine shutting down unexpectedly, e.g. due to power loss (T214543)
- (Unclear what happens in case of a single browser tab crashing vs entire browser crashing, might behave differently)
We should therefore consider switching from sessionStorage to localStorage.
Minimum test case
- Draft a comment using the Reply Tool
- Close the page you were drafting a comment on/within
- Re-open the page from "Step 2." in a new browser tab
- ✅ Verify the reply tool opens and the comment you started drafting in "1." is restored