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
Token preemptively completing experiments... #160
Comments
So to clarify this only happens with adding the token to the URL, and not when you provide directly in the interface? |
Yes this happens when I add the token to the URL. Sorry not sure what that means to provide it directly in the interface? Do you mean in interactive mode? |
yep! So normally there is a box you can enter it in (not in the browser url), and I would call that some kind of interactive mode. Does everything work okay with that method? |
I will try that and report back! |
I'm in the middle of the work day so I can't debug for you, but I can tell you what I think is going on (and how to debug!) So this function: expfactory/expfactory/views/main.py Lines 119 to 143 in 1b0b570
It looks like the last block is being skipped over (no experiment found) and then it's going directly to finish. So what we are going to do is put a ton of print statements around there, and install from your local version to build the container. E.g., from your repo
And then in your Dockerfile instead of:
Do:
And then in that function, try something like this: @app.route("/next", methods=["POST", "GET"])
def next():
# Headless mode requires logged in user with token
if app.headless and "token" not in session:
return headless_denied()
# To generate redirect to experiment
experiment = app.get_next(session)
# I suspect you are going to see None here!
print(experiment)
print(experiment is not None)
if experiment is not None:
app.logger.debug("Next experiment is %s" % experiment)
template = "/experiments/%s" % experiment
# Do we have runtime variables?
token = session.get("token")
if app.vars is not None:
variables = get_runtime_vars(
token=token, varset=app.vars, experiment=experiment
)
template = "%s?%s" % (template, variables)
print("We got to performing checks, next experiment is %s" % experiment)
return perform_checks(template=template, do_redirect=True, next=experiment)
# But I think you are skipping the above and hitting down here
return redirect("/finish") so then the question is - why is app.get_next() returning there aren't experiments? That bit is here: expfactory/expfactory/server.py Lines 99 to 114 in 1b0b570
expfactory/expfactory/server.py Line 107 in 1b0b570
expfactory/expfactory/server.py Lines 71 to 97 in 1b0b570
docker logs to see it. And I've been wanting to make it easier to see logs in that respect, so if you find a change that works please open a PR! Keep me updated!
|
This is pretty great "middle-of-workday" feedback! I am in France right now so heading to bed atm but will take a look at this in the morning! |
Any progress or updates here? |
I haven't tried this is a while - have been giving people tokens for them to enter instead. I have this semi-automated using airtable automations (in terms of emailing each participant their token) so this has been my workaround. |
Safe to close then until someone reproduces? |
I think that is fine! Thanks for the follow up :) |
I can reproduce this issue in the current version. |
oh that's good! Can you use my previous instructions #160 (comment) to debug? Re-opening too. |
Version of Experiment Factory:
Latest
Expected behavior
Following the guide for Usage > Use Tokens I attempted to provide a pre-generated URL using the suggested format:
I expected to start the battery of experiments with the results saved to the folder associated with the provided token.
Actual behavior
What happened instead was that a banner appeared saying that I had completed all the experimnets:
Also the user folder on the server was also marked as
_finished
(appended to the folder token name)Steps to reproduce behavior
You can run from my public repo - also I have tried this with various combinations of experiments and the behavior has occurred each time.
The text was updated successfully, but these errors were encountered: