mountetna / timur

Data browser for biologists
GNU General Public License v2.0
3 stars 6 forks source link

Edit mode automatically resets to browse mode if editing before tab documents returned #278

Open coleshaw opened 3 years ago

coleshaw commented 3 years ago

When a constructed view has multiple tabs, a Magma /retrieve request is made for each tab. However, if a user enters "Edit" mode before all those requests return, every time a request returns, the page automatically resets itself to "Browse" mode, which is super confusing.

This can be seen in production with an rna_seq record (because they have four tabs?), like https://timur.ucsf.edu/ipi/browse/rna_seq/IPIADR002.T1.rna.tumor#overview or https://timur.ucsf.edu/ipi/browse/rna_seq/IPICRC003.T1.rna.tcell#overview.

To reproduce:

1) Open one of the rna_seq records above. 2) Open the dev tools / network tab to watch the requests. 3) Click the pencil / Edit icon as soon as the page appears to load. 4) There should be 4 requests to Magma /retrieve. The first one or two will have finished by the time you click Edit. 5) Watch the network page. As the last couple of requests finish, the page will automatically change back to Browse mode with no intervention from the user. NOTE: It appears that each request is identical, and thus redundant. It should be possible to streamline the calls to one.

coleshaw commented 3 years ago

Okay, this is difficult to replicate locally, but it seems like the issue is that Timur makes multiple retrieve calls to Magma (one per tab?) now, even though the request is identical in each case. If you try to edit before the last retrieve call returns, the page resets to Browse mode after each call is returned...