Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky job_id prevents server from fetching databases #574

Open
marcadella opened this issue Jan 25, 2022 · 5 comments
Open

Sticky job_id prevents server from fetching databases #574

marcadella opened this issue Jan 25, 2022 · 5 comments
Labels
Projects

Comments

@marcadella
Copy link

After doing a search the last job_id is stored in a cookie (I guess).
But if the server is restarted at that point, the job_id doesn't exist anymore and the following Ajax request:
https://mmp-blast.sfb.uit.no/searchdata.json?job_id=8dbf489f-f739-4321-9bf3-ff84af2cee86

returns:

{"message":"The requested job could not be found","title":"Job not found","more_info":""}

and the consequence is that the list of databases is not and the UI does not let a user submit a new query (since no db has been selected).

Sequenceserver should fail gracefully when a job_id does not exist.

@yeban
Copy link
Collaborator

yeban commented Jan 30, 2022

Agreed.

In the mean time, you have two options:

  1. Refreshing the page clears the job_id (it is stored in sessionStorage, btw)
  2. Open a new tab - since the job_id is stored in sessionStorage, it only persists in the current tab.

Note to my future self or anyone else who takes up this issue:
The API endpoint should probably distinguish between XHR and non-XHR request. For XHR request, job_id should be ignored when it does not exist. For non-XHR request, we retain the current behaviour. Additionally, SequenceServer probably shows the above error message in a modal if the user goes to 'localhost:4567/?job_id=...' (if the error is not displayed in a modal, it should be). The modal should give the user an option to start a new search.

@yeban yeban added the bug label Jan 30, 2022
@yeban yeban added this to To do in 2.1 Jan 30, 2022
@marcadella
Copy link
Author

@yeban The funny thing is that neither refreshing the page nor opening a new tab worked! The only solution that worked was to open a new incognito window (using chrome). That's why I assumed it was stored in a cookie.

@yeban
Copy link
Collaborator

yeban commented Feb 9, 2022

@marcadella Do you any see any error message in the browser console when you try to refresh? Which version of Chrome are you using?

@marcadella
Copy link
Author

Ok, I get it know. I can see job_id in sessionStorage and it stays there when I reload the page (expected behavior for sessionStorage). I tried to open a new tab and it was cleared as expected.

So I just disagree with your solution 1 since sessionStorage is not cleared upon page reload.

@yeban
Copy link
Collaborator

yeban commented Feb 23, 2022

Hello. I am sorry, it's not currently possible for me to respond sooner.

If SequenceServer is not clearing sessionStorage for you on page refresh, then we have a bug (search.js#L12-18). But I cannot reproduce it on my end. Do you see any error message or warnings in the browser console that can help troubleshoot the issue? What version of Chrome are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
2.1
To do
Development

No branches or pull requests

2 participants