oda-hub / dispatcher-app

Other
2 stars 2 forks source link

url sent in email can not be used, need to compare with that given by frontend #105

Closed volodymyrss closed 3 years ago

burnout87 commented 3 years ago

Which one is the one from the frontend?

volodymyrss commented 3 years ago

In both cases, there was a token, and it should be removed

from email:

https://frontend.staging.odahub.io/cdci/astrooda/?src_name=4U+1700-377&RA=257.815417&DEC=-41.593417&T1=2003-03-15T23%3A27%3A40.0&T2=2003-03-16T00%3A03%3A15.0&T_format=isot&instrument=isgri&osa_version=OSA10.2&radius=15&use_scws=no&max_pointings=50&integral_data_rights=public&E1_keV=20&E2_keV=401&query_type=Real&detection_threshold=5&product_type=isgri_image&query_status=new&session_id=TFDZNALPGV16UC2A&job_id=&user_catalog_file=None

from frontend:

https://frontend.staging.odahub.io/cdci/astrooda/?DEC=-41.593417&E1_keV=20&E2_keV=401&RA=257.815417&T1=2003-03-15T23%3A27%3A40.0&T2=2003-03-16T00%3A03%3A15.0&T_format=isot&detection_threshold=5&instrument=isgri&integral_data_rights=public&max_pointings=50&osa_version=OSA10.2&product_type=isgri_image&query_status=ready&query_type=Real&radius=15&src_name=4U+1700-377&use_scws=no

volodymyrss commented 3 years ago

maybe would be useful to sort the parameters too, for better repeatability.

burnout87 commented 3 years ago

Using the same ordering style used in the frontend makes sense.

from email:

https://frontend.staging.odahub.io/cdci/astrooda/?src_name=4U+1700-377&RA=257.815417&DEC=-41.593417&T1=2003-03-15T23%3A27%3A40.0&T2=2003-03-16T00%3A03%3A15.0&T_format=isot&instrument=isgri&osa_version=OSA10.2&radius=15&use_scws=no&max_pointings=50&integral_data_rights=public&E1_keV=20&E2_keV=401&query_type=Real&detection_threshold=5&product_type=isgri_image&query_status=new&session_id=TFDZNALPGV16UC2A&job_id=&user_catalog_file=None

from frontend:

https://frontend.staging.odahub.io/cdci/astrooda/?DEC=-41.593417&E1_keV=20&E2_keV=401&RA=257.815417&T1=2003-03-15T23%3A27%3A40.0&T2=2003-03-16T00%3A03%3A15.0&T_format=isot&detection_threshold=5&instrument=isgri&integral_data_rights=public&max_pointings=50&osa_version=OSA10.2&product_type=isgri_image&query_status=ready&query_type=Real&radius=15&src_name=4U+1700-377&use_scws=no

Is this just an example? Because I just noticed that the url from the frontend does not have the session_id and job_id...

volodymyrss commented 3 years ago

Using the same ordering style used in the frontend makes sense.

from email: https://frontend.staging.odahub.io/cdci/astrooda/?src_name=4U+1700-377&RA=257.815417&DEC=-41.593417&T1=2003-03-15T23%3A27%3A40.0&T2=2003-03-16T00%3A03%3A15.0&T_format=isot&instrument=isgri&osa_version=OSA10.2&radius=15&use_scws=no&max_pointings=50&integral_data_rights=public&E1_keV=20&E2_keV=401&query_type=Real&detection_threshold=5&product_type=isgri_image&query_status=new&session_id=TFDZNALPGV16UC2A&job_id=&user_catalog_file=None from frontend: https://frontend.staging.odahub.io/cdci/astrooda/?DEC=-41.593417&E1_keV=20&E2_keV=401&RA=257.815417&T1=2003-03-15T23%3A27%3A40.0&T2=2003-03-16T00%3A03%3A15.0&T_format=isot&detection_threshold=5&instrument=isgri&integral_data_rights=public&max_pointings=50&osa_version=OSA10.2&product_type=isgri_image&query_status=ready&query_type=Real&radius=15&src_name=4U+1700-377&use_scws=no

Is this just an example? Because I just noticed that the url from the frontend does not have the session_id and job_id...

I made a real, request copied link from email, and when also when the product was ready, from frontend (see "Share" button there). So it is an example, but it is precisely real case. see "Share" button ends up showing the url constructed by the same dispatcher function, at different time.

burnout87 commented 3 years ago

Yep, just seen it. So, is this a problem on the fronted? should @motame be notified for this?

volodymyrss commented 3 years ago

The urls are constructed fully by the dispatcher. The fact that they are different is problem of the dispatcher. Frontend only needs to ensure that the conventional url is leading to correct request, which it did and still does. Of course, we could ask @motame adapt the convention to interpret different kinds of urls. But if want to bother @motame less, could we instead ensure that the urls provided by the dispatcher in both cases are identical? Or at least compatible.

burnout87 commented 3 years ago

For my understanding, is the email provided by the frontend the one generated here?

https://github.com/oda-hub/dispatcher-app/blob/84c492c1a21dfa278270af84279e621c7fabfd91/cdci_data_analysis/analysis/job_manager.py#L205

and used here:

https://github.com/oda-hub/dispatcher-app/blob/84c492c1a21dfa278270af84279e621c7fabfd91/cdci_data_analysis/analysis/queries.py#L489

burnout87 commented 3 years ago

For my understanding, is the email provided by the frontend the one generated here?

https://github.com/oda-hub/dispatcher-app/blob/84c492c1a21dfa278270af84279e621c7fabfd91/cdci_data_analysis/analysis/job_manager.py#L205

and used here:

https://github.com/oda-hub/dispatcher-app/blob/84c492c1a21dfa278270af84279e621c7fabfd91/cdci_data_analysis/analysis/queries.py#L489

Sorry this was probably a non-sense question.

I will make a PR and create some tests for this purpose

volodymyrss commented 3 years ago

indeed, the present issue is not with the callback url, but with products url.

this one

https://github.com/oda-hub/dispatcher-app/blob/45e7146ef84093206bbb3e019b11229b890b4ecf/cdci_data_analysis/flask_app/dispatcher_query.py#L598