SETI / rms-opus

PDS OPUS - Outer Planets Data Search Tool
Apache License 2.0
9 stars 7 forks source link

Out of sync error happens sometimes when the slide view modal is open, observations are being fetched, and the arrow key is trying to move to a new slide #1108

Open dstopp opened 3 years ago

dstopp commented 3 years ago

In console, error message: metadataboxHtml: in each, observationData may be out of sync with colLabels;

Steps to reproduce the issue: Add some API delay. In gallery view, open up a slide view modal, and hold the down arrow key and it will move down to trigger initInfiniteScroll load. When spinner is still running, click edit in the modal and delete a metadata col. At the same time, keeping hitting down key maybe for about 3 to 4 times, then we can see the error message in the console. Most of the time, all metadata info will still be loaded fine, but sometimes it will have a blank right pane without any metadata info.

Note that this issue can also be duplicated in the table view w/out adding delay. Similar steps; open a slide view modal; trigger a fetch of new observations; edit the metadata via the modal interface and at same time, press the right or down key.

Example message: opus.js:148 ERROR: metadataboxHtml: in each, observationData may be out of sync with colLabels; opusId = co-uvis-euv2004_093_17_14, colLabels = Instrument Name,Planet,Intended Target Name,OPUS ID,Observation Start Time,Observation Duration (secs),Nominal Target Class

dstopp commented 3 years ago

Note: This issue can also be duplicated by opening a slide view modal; scroll the binoculars off the top of the screen enough so it is no longer visible.
Edit the metadata via the slide view modal. Note that the metadata will disappear and in the console, an error logged for 'out of sync'.
This is because of the way the data is fetched after the metadata is done - first, the current window of observations plus the window of observations just below (out of view) are fetched. Then a second window, the previous observations, are fetched via ps-scroll-up. Since the slide view modal was just off the screen when the process was started, the first fetch doesn't retrieve that observations data, so an error is thrown and no metadata is rendered on the slide view modal.

We may need to rethink how we are retrieving the data in this scenario, likely fetching previous, current and next windows of observations in one fetch instead of two.