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

Move long process to background thread #2328

Closed

Conversation

FikriMilano
Copy link
Collaborator

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #2274

Description

  • Limiting calculation of calculatedExpression to the current page
  • Move the execution of getQuestionnairePages to background thread (can take 2 seconds if the questionnaire has ~30 enableWhenExpression that's also using variableExpression)
  • Show circular progress bar on the next page button until the background process is complete

Alternative(s) considered
Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type
Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)

Screenshots (if applicable)

Checklist

  • I have read and acknowledged the Code of conduct.
  • I have read the Contributing page.
  • I have signed the Google Individual CLA, or I am covered by my company's Corporate CLA.
  • I have discussed my proposed solution with code owners in the linked issue(s) and we have agreed upon the general approach.
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the style guide of this project.
  • I have run ./gradlew check and ./gradlew connectedCheck to test my changes locally.
  • I have built and run the demo app(s) to verify my change fixes the issue and/or does not break the demo app(s).

@FikriMilano
Copy link
Collaborator Author

@jingtang10
Copy link
Collaborator

this is really great work @FikriMilano!

have you considered disabling the questions that have expressions that are being calculated until the background thread returns?

also can you screenrecord a short video?

@FikriMilano
Copy link
Collaborator Author

FikriMilano commented Jul 29, 2024

@jingtang10 sorry for the delay, this PR was pending since in the past, it's not stable yet.

This PR has been separated into 2 parts for clarity:
Async getQuestionnairePages and Add progress bar to the 'Next' button #2645
Improve initial load of calculated expression #2522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Optimize laggy forms calculation
3 participants