-
Notifications
You must be signed in to change notification settings - Fork 66
Fixed #661: wrap app_name query in xdmp:eval to provide appropriate context #768
Fixed #661: wrap app_name query in xdmp:eval to provide appropriate context #768
Conversation
In case someone wonders, a simple way to run a quick test is to copy the execute_query_8 into app_specific.rb, and run the test code I provided in this comment of #661: #661 (comment) |
Having two problems with this PR...
Seems like to fix this its time to finally introduce execute_query_9 ...
Too tired to figure this one out I will try to debug it in the morning. EDIT : I noticed that when running issue 2 on port 8000 it also fails with this error when you use anything other than the "Documents" database. Possibly a bug in the REST API on latest ML8 on Windows? |
Thanks, good finds. I should have tested my code against other than latest. I'll poke some more at this.. |
…ovide appropriate context
Issue 2 might just be bad test code. The bit of code I referred to above tries to get the database-name, but does not anticipate modules-db being set to (file system), which is the case for no params, since that reverts to the Manage app-server. Use this code instead:
Also make sure you bootstrap before you run that test, otherwise mentioned values will be wrong (details for Manage or some random app-server). I'm investigating running exec_8 against ML8.. |
5ac49a4
to
f156aaa
Compare
This should work better.. I'm printing warnings for ml7- if a referenced db_name or app_name is not found. The execute_query_5/7 seemed to be very forgiving, a bit too much I think. The execute_query_8 however is not forgiving, no fallback if db_name or app_name refers to non-existing items. I added a check upfront, and raise an exception if non-existing. The effect is similar if we don't do this, but the feedback for the user is cleaner this way. I also applied a trick with fn:function-lookup to be server-version agnostic. All seems to run smooth against ml7, ml8, and ml9 now.. |
@RobertSzkutak Can you give it another spin? |
Everything looks good! |
Fixes #661