peerreview icon indicating copy to clipboard operation
peerreview copied to clipboard

Review Comments can be Lost if Page Refreshed before Blur

Open danielBingham opened this issue 10 months ago • 0 comments

Right now we save review summaries and comments on blur. However, if the user navigates away or refreshes the page before they click out of the text box, that means the content is lost. This could definitely occur and cause a user to lose a carefully crafted review, which we don't want.

However, saving onChange is not necessarily something we want to do either. On change can fire really frequently and debouncing it is not unintensive. One thing we could do is have an onChange handler that we only fire once every few seconds to save the difference. That way if someone spends a long time carefully typing up a comment, we're not firing PATCH an unreasonable amount, not doing a debounce dance, we're just checking the time and only firing if a certain amount has passed. Do that along with blur and we should be able to avoid too much loss.

danielBingham avatar Oct 21 '23 17:10 danielBingham