-
-
Notifications
You must be signed in to change notification settings - Fork 8
Major refactor fo loadFormData. _rlv now reloads last values whether a user has changed them or not. Connection fields now reliably load last values. Added multiple retries to make sure. #554
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
Conversation
…a user has changed them or not. Connection fields now reliably load last values. Added multiple retries to make sure. Refactors form data loading to enhance reliability, modularity, and error handling when restoring persistent form fields . Introduces robust connection field hydration with retry logic and event-driven updates, reducing race conditions and ensuring consistent restoration across various field types. Converted some code to vanilla JS ready for the KTL-NG (Not Chosen & Redactor as Jquery Plugins). Improves maintainability by modularizing field hydration, handling corrupted storage, and optimizing field-specific logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the persistent form data loading mechanism to improve reliability and maintainability. The key improvements include modularizing field hydration logic, adding robust retry mechanisms for connection fields, implementing event-driven updates, and migrating portions of the code to vanilla JavaScript in preparation for reducing jQuery dependencies.
Key Changes:
- Introduced retry logic with exponential backoff and event-driven updates for connection field hydration to handle race conditions
- Refactored monolithic form loading into separate, focused hydration functions for each field type
- Added enhanced error handling for corrupted storage data with graceful fallbacks
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…d improves field value handling Unifies and streamlines scene/view loaded marking, replacing duplicated code with reusable functions for improved maintainability. Enhances field hydration logic for text, connection, and multiple-choice fields with better attribute escaping, input normalization, and robust error handling. Removes unreliable event-based connection hydration retries, switching to simpler logic for more predictable behavior. Fixes typos in selector class names to ensure correct event triggering. Refactors persistent form hydration and improves reliability Streamlines scene and view loaded logic by consolidating marking into reusable functions, improving maintainability and event consistency. Enhances field hydration for text, connection, and multiple-choice types with better value normalization, robust error handling, and improved attribute escaping. Removes unreliable event-based connection hydration retries for more predictable field population. Corrects class name typos to ensure events trigger as intended. Addresses maintainability, hydration accuracy, and user experience for persistent forms.
… into fix/_rlv-reloading-connection-fields
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Enhances connection field hydration with verification and retry logic, ensuring field values are correctly applied before finalizing persistence. Adds pending-save queuing to prevent data loss during hydration, and introduces exponential backoff for retries, reducing UI glitches and persistence errors. Improves boolean field handling and normalizes value checks for more robust data application.
… into fix/_rlv-reloading-connection-fields
Refactors form data hydration logic to better handle Knack mutations after connection loads, preventing loss of restored values. Adds rating widget persistence and refines date/time field handling for reliability. Keeps cached values across refreshes until submit, scene change, or expiry. Fully tested in KTL-tutorials app.
Refactors form data loading to enhance reliability, modularity, and error handling when restoring persistent form fields. Knacks connection fields have a habit of loading later than the view and under past issues we have had they can mutate even after the knack connections load triggers. Most of this refactor is to gurantee that the connections load the correct value. Introduces robust connection field hydration with retry logic and event-driven updates, reducing race conditions and ensuring consistent restoration across various field types. Converted some code to vanilla JS ready for the KTL-NG (Not Chosen & Redactor as Jquery Plugins).
Improves maintainability by modularizing field hydration, handling corrupted storage, and optimizing field-specific logic.