-
Notifications
You must be signed in to change notification settings - Fork 161
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
Speed up enabling buttons to open form in Enketo #385
Comments
I'm going to try to address the "existing draft is updated" case by copying-forward the Enketo ID from draft to draft. We already copy-forward the draft token and form attachments from draft to draft. For the "new draft is created" case and maybe also the "form is published for the first time" case, I'm planning to implement the following:
With these changes, it might not be necessary to change the worker or the Frontend polling. We have getodk/central-backend#533 to think about adjusting the worker. We might also tune the Frontend polling, in part because that polling can be noisy during local development. |
Addresses the "existing draft is updated" case of getodk/central#385.
Addresses the "new draft is created" case of getodk/central#385.
It turns out that the "new draft is created" case actually becomes two subcases:
In the former case, I made progress on this issue in getodk/central-backend#782. I've addressed these two cases:
I'm planning to continue working on this issue during .3 in order to address the remaining cases:
Once those changes are made, part of me thinks that we could remove the Frontend polling altogether. If the vast majority of Enketo IDs can be generated during the request rather than by a worker, it would be great if we could remove this source of complexity in Frontend. @lognaturel, I know you've seen the latest behavior in action on the QA server. Do you think that you tried out both of the cases that I addressed in getodk/central-backend#782? I'm thinking that as long as you've taken a look, we probably don't need the QA team to also verify. |
Sorry I missed that tag! You probably saw my comment in Slack saying it's changed my life. 🌟 Looking forward to the next couple of cases! |
This comment was marked as outdated.
This comment was marked as outdated.
@getodk/testers, this issue is ready to be verified, on either staging or the QA server. Previously, it was common to see a message like "Preview has not finished processing for this Form." However, now Enketo should be enabled right away. When a new form is created, or a new draft is created, or a draft is published, preview and submission should be available in Enketo right away. |
There is a descending order of submission order numbers applied after using the "Refresh" button in Draft submission table and Submissions table. The issue occurs both with submission via Enketo and Collect. (The issue doesn’t occur on sandbox) Steps to reproduce:
The order is correct if you:
|
Another thing that I'm not sure if it's related to the PR and I tried to figure out why/when it happens but haven't found reproducible steps yet.. maybe someone will have some ideas when it happens: |
I don't think this would have been affected by the changes here, but I think this is probably related to getodk/central-frontend#741. I'll leave a comment there about this. |
I see 4 other form drafts in this state that were created this year. They were all created between 2023-08-10 09:16:29 and 2023-08-10 09:28:45 UTC. Looking at Slack, it looks like the QA server ran out of disk space around that time. If Enketo is down for a little while, then Web Forms won't be made available for forms or form drafts created during that time. However, as you've seen, they can be made available once Enketo is back up, by republishing the form. It should be rare for Enketo to be down. |
Would you mind double-checking this? It should be fixed now. |
Thank you Matthew for help I wouldn't figure that one on my own. The descending order is fixed. |
Tested with success! |
Tested with success! |
Currently it takes several seconds (20+) for web form buttons (Preview and +New) to be enabled in these cases:
The following do NOT take time to be enabled:
The "existing draft is updated" case is the one that adds a lot of friction. I believe it is identical to the "new draft is published" case. That is, both have a stable Enketo ID that can be reused. The Enketo ID is determined by Enketo Express using the host URL and the form_id. The host URL stays stable within a draft editing session (because the draft token is stable). I believe in the "existing draft is updated" case we should be able to keep the buttons enabled like we do for the "new draft is published" case.
It would also be valuable to speed up the "new draft is created" and "form is published for the first time" cases. My current understanding of why this is slow is that:
Enketo's response is going to be near-instant in almost all cases, especially using EE 6.
I understand the desire not to couple form creation too tightly with preview generation. Could we do something like have backend block on Enketo's response with an aggressive timeout (500ms or 1s) and fall back to the existing async model?
The text was updated successfully, but these errors were encountered: