You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
When a form is published, a
singleUse
actor is created and assigned theformview
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.
The text was updated successfully, but these errors were encountered: