Skip to content
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

Questions about actors with formview assignments #997

Open
matthew-white opened this issue Sep 19, 2023 · 0 comments
Open

Questions about actors with formview assignments #997

matthew-white opened this issue Sep 19, 2023 · 0 comments
Labels
documentation API docs, readme, developer docs

Comments

@matthew-white
Copy link
Member

When a form is published, a singleUse actor is created and assigned the formview role. A session of 15 minutes is created for the actor. Backend then sends a request to Enketo, specifying the session token in a __Host-session cookie. Presumably, this is to provide Enketo access to the form. Enketo responds with Enketo IDs that are used to preview the form (among other things).

However, it's not clear to me what the exact flow is from there. Enketo doesn't seem to request the form from Backend before returning its response, because in many cases, we request Enketo IDs for a form that is not yet created or published. Does Enketo hold onto the session token and send a request for the form soon after its response, but before the session's 15-minute expiration? Is there any chance that Enketo only requests the form when a user first uses the form in Enketo? In that case, the actor with the formview assignment wouldn't be needed.

Another question: even if the actor is needed, is it in fact single-use? I'm thinking that Enketo must send multiple requests: first for the OpenRosa formList, then for the form's XML and maybe also the form's attachments. I'm wondering this in part because I'm thinking about when/how we should delete the actor. We could consider deleting the actor after its first use, but that wouldn't work if it's used for multiple requests. Right now, I don't think we delete these actors at all. Related: #996.

Whatever the answers to these questions are, I think it'd be helpful to document them in code comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation API docs, readme, developer docs
Projects
None yet
Development

No branches or pull requests

1 participant