Skip to content

Fix rendering double note issue

username-removed-502136 requested to merge acet-fix-double-note-render into master

The story of double rendering note problem was,

We do polling to update the page with new notes and that polling request was also including newly posted note. When we get the polling response, we assume that it's a new note and render it on the page. Then we get the response of the actual note save request and we render it again. That's why we were seeing double rendered note.

To fix this bug, I added a check to only add new notes to store by comparing them with their ids. This initially fixed the double rendering. However we couldn't properly remove the placeholder and it was visible on the page for a few more seconds. Placeholders only removed when we get the response of our request. More on this can be found in this comment To solve the placeholder issue I need to disable polling while submitting a new note, then when we get the response, we immediately restart polling and do a new request to update the page with new notes.

Fixes #38139 (closed)

Before After
_double-rendered-note _double-rendered-note-fixed

Merge request reports