view · edit · sidebar · attach · print · history

Index>

20141006-make-grantdownloads-work

Summary

  • Make grant downloads work again
  • Analysing error with Download Zulassungsinhaber Desitin

Commits

Index

Keep in Mind
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • Fix analyses search. Eg. for Akute myeloische Leukämie

---

Analysing error with Download Zulassungsinhaber Desitin

I still don't get a CSV-file when trying to download the CSV export for Desiting. Tried http://oddb-ci2.dyndns.org/de/gcc/export_csv/zone/drugs/search_query/Desitin/search_type/st_company. Asking myself again. Why the hell don't I get a clear error message from somewhere?

Added more debug statement. But still don't know what is happening.

Debug output looks like this at the moment

Session::active_state ODDB::State::Drugs::Result
Session::active_state @persistent_user_input changed to {:flavor=>"gcc", :language=>"de", :drugs=>{}, :search_form=>"plus", :search_query=>"inderal", :search_type=>"st_sequence"}
util.session process request /de/gcc/export_csv/zone/drugs/search_query/inderal/search_type/st_sequence
Session::active_state ODDB::State::Drugs::Result
State::Drugs::Result export_csv  creditable? true
util.session process request /de/gcc/ajax_swissmedic_cat/reg/31706/seq/02/pack/033
Session::active_state ODDB::State::Drugs::PaymentMethod
util.session process request /de/gcc/ajax_swissmedic_cat/reg/31706/seq/02/pack/122
Session::active_state ODDB::State::Drugs::PaymentMethod
util.session process request /de/gcc
Session::active_state ODDB::State::Drugs::PaymentMethod
util.session process request /de/gcc
Session::active_state ODDB::State::Drugs::RegisterInvoicedDownload
in appdown.html waiting long time
util.session process request /
Session::active_state ODDB::State::Drugs::RegisterInvoicedDownload

Will continue tomorrow.

Make grant downloads work again

Zeno remarked that granting a user download right does not work again. It worked fine till about two weeks ago. Running the command grant_download 'user@example.com', 'oddb2.csv', 17, Time.local(2015,9,30) worked fine in bin/admin, but the resulting link does not work http://ch.oddb.org/de/gcc/download/invoice/id/email/user@example.com/filename/oddb2.csv@@.

With my commit https://github.com/ngiger/oddb.org/commit/d8f6383bd0256bfbf2f0a33265231283ad52b06d Fix ajax search from September 15 I changed various stuff on how the persistent user input is maintained. I suspect this to break things like a grant download. Therefore I will try the following steps:

  • Save my current state in a new (local) branch debug_output. Maybe I will keep this branch for longer as it just enable a better tracing of where the code passes (or may be add a configuration option debug/trace in config/oddb.yaml)
  • revert to the state before commit d8f6383bd0256bfbf2f0a33265231283ad52b06d to see whether I still have the problem
  • Develop a watir test for the grant problem in yet another branch grant_download
  • Pulling the changes from master into grant_download since then in small steps to see where I introduced the problem

But first I delete some no longer used local and remote branches. Created new branch grant_download and added all newer watir tests. Running them. They pass.

When testing locally under oddb-ci2 with bin/admin

ch.oddb> grant_download 'email@domain.com', 'oddb.csv', 17
-> http://ch.oddb.apache.org/de/gcc/download/invoice/32356772/email/email@domain.com/filename/oddb.csv

I see that the command returns a wrong URL with ch.oddb.apache.org instead of http://oddb-ci2.dyndns.org/de/gcc/download/invoice/32356772/email/email@domain.com/filename/oddb.csv. When using the corrected URL http://oddb-ci2.dyndns.org/de/gcc/download/invoice/32356772/email/email@domain.com/filename/oddb.csv the download worked. Now creating a watir tests is a little bit more complicated as it involves a bin/admin command. Adding a helper function for this in spec/spec_helper.ch. Added new file spec/download_spec.rb which runs fine.

Now cherry-picking spec/download_spec.rb and running spec/download_spec.rb again. Running spec/download_spec.rb is still without failures. Testing it manually (with oddb.csv) works, too.

Okay. I suspected the wrong commit. The next suspicious commit is https://github.com/ngiger/oddb.org/commit/ee60861a788e88dc15aa4c5b87889cccb3d7d779#diff-6. Cherry-picking and testing it, too. And now running the new watir tests fails! Great! Now must find a way on how to able to checkout via paypal and granting via bin/admin to work. Fix the part of above mentioned patch to make spec/download_spec.rb pass. Running all watir tests to look for side effects. I can explain all of the 7 failing tests with either (in branch master but not yet in branch grant_download) or broken in master.

Therefore I am switchting back to master and cherry-picking the changes from grant_download. Pushed commits:

Pulled the changes on thinpower. Restarted ch.oddb and the link works fine again.

view · edit · sidebar · attach · print · history
Page last modified on October 06, 2014, at 05:46 PM