oda-hub / dispatcher-app

Other
2 stars 2 forks source link

use_scws not set correctly on `form_list` but only in `done` email? #255

Closed volodymyrss closed 2 years ago

volodymyrss commented 2 years ago

This information below was received in the same done email:

https://www.astro.unige.ch/mmoda/?DEC=-29.74516667&E1_keV=20&E2_keV=40&RA=265.97845833&T1=2017-03-06T13%3A26%3A48.0&T2=2017-03-06T15%3A32%3A27.0&T_format=isot&detection_threshold=7&instrument=isgri&integral_data_rights=public&max_pointings=50&osa_version=OSA10.2&product_type=isgri_image&query_status=new&query_type=Real&radius=15&scw_list=066500230010.001&src_name=1E+1740.7-2942&use_scws=no

par_dict = {
"DEC": "-29.74516667",
"E1_keV": "20",
"E2_keV": "40",
"RA": "265.97845833",
"T1": "2017-03-06T13:26:48.0",
"T2": "2017-03-06T15:32:27.0",
"T_format": "isot",
"detection_threshold": "7",
"instrument": "isgri",
"integral_data_rights": "public",
"max_pointings": 50,
"osa_version": "OSA10.2",
"product": "isgri_image",
"product_type": "Real",
"radius": "15",
"scw_list": "066500230010.001",
"src_name": "1E 1740.7-2942",
"token": "REDACTED"}

Notice how it should not be possible to have use_scws=no with this API code.

The query was for this one SCW. The link the in submitted email was correct:

https://www.astro.unige.ch/mmoda/?DEC=-29.74516667&E1_keV=20&E2_keV=40&RA=265.97845833&T1=2017-03-06T13%3A26%3A48.0&T2=2017-03-06T15%3A32%3A27.0&T_format=isot&detection_threshold=7&instrument=isgri&integral_data_rights=public&max_pointings=50&osa_version=OSA10.2&product_type=isgri_image&query_status=new&query_type=Real&radius=15&scw_list=066500230010.001&src_name=1E+1740.7-2942&use_scws=form_list

To reproduce, ask for any new scw (e.g. 0665002*0010.001)

The test for this does not check done emails:

https://github.com/oda-hub/dispatcher-app/blob/master/tests/test_job_management.py#L1358

It should be changed to do this.

volodymyrss commented 2 years ago

this fixes it:

https://github.com/oda-hub/dispatcher-app/blob/cc3ec4a7111d977ece9dc8d98eadfa7197272b25/cdci_data_analysis/flask_app/dispatcher_query.py#L779-L786

but a more proper solution is needed, perhaps using set scw related params at that stage.

burnout87 commented 2 years ago

this fixes it:

https://github.com/oda-hub/dispatcher-app/blob/cc3ec4a7111d977ece9dc8d98eadfa7197272b25/cdci_data_analysis/flask_app/dispatcher_query.py#L779-L786

but a more proper solution is needed, perhaps using set scw related params at that stage.

Yes, though this is not complete, I can provide a PR now.

volodymyrss commented 2 years ago

I mean, it should be tested and all. I appreciate the commitment but if I can not review it until tomorrow. What's deployed fixes this particular condition. But we need to scan through all cases to check that callback done email is correct.