tidepool-org / blip

Blip is the internal name for Tidepool for Web, a tool for seeing diabetes data in one place.
https://tidepool.org/products/tidepool/
BSD 2-Clause "Simplified" License
106 stars 54 forks source link

[WEB-2961] Print range error fix #1386

Closed krystophv closed 2 months ago

krystophv commented 3 months ago

for WEB-2961 - tracked down the issue to a re-render loop that occurs when trying to fetch additional data during the PDF generation, since patientdata will presume that it re-renders during the PDF request (due to the store state changes throughout the process) and pick up on various states to continue the process. The synchronous setting of pendo data in the middleware after data fetch success will cause a re-render prior to the data success action returning, and during the new re-render, patientdata will try to initialize PDF generation again since it sees that new data has arrived, but hasn't been added to the data worker/processed. This process will loop. By just not setting the pendo data if it hasn't changed, we avoid the loop condition.