support icon indicating copy to clipboard operation
support copied to clipboard

Save draft review on a Pull Request

Open amit1rrr opened this issue 5 years ago • 2 comments

Problem

A user writes a detailed review on a notebook and their browser crashes before they could post the review. Well written comments are lost. This is not the experience we want our users to have.

Solution

Draft review can be stored on our backend server or localStorage of the browser. Some considerations --

  • We do not store any pull request comments on our servers, we merely act as a passthrough to GitHub i.e. we post all PR comments to GitHub directly. So storing draft comments on our server is against our promise of "we do not store any of your PR comments". Draft comments are only cached until the review is posted to GitHub so this might be an acceptable exception.

  • localStorage of the browser is a preferable place for draft comments as it'll only store comments locally & the draft review will still be available across sessions. But this might not work in case of incognito mode or across browsers or if user clears browser history and such. More research to be done on the possible failure cases for localStorage & see if those are acceptable.

amit1rrr avatar Sep 10 '20 06:09 amit1rrr

I appreciate the focus on privacy, though I've lost a few comments since I didn't know this was the default behavior.

A middle ground may be to have a "Save Review" button to cache PR comments on ReviewNB servers. To explicitly get user consent, you can show a confirmation message on click, or even disable the button unless a "it's okay to store comments on ReviewNB" flag is turned on in settings.

kennysong avatar Jul 10 '22 11:07 kennysong

At least the overall review comment seems to survive even a hard reload of the page.

Update: I lost the draft comment due to browser restart, so not sure how it could survive the hard reload but not a browser restart.

haridsv avatar Jul 21 '23 06:07 haridsv