Skip to content

Fix Rendering Regression and Race Conditions in RuleConfigModal#218

Open
ruzaqiarkan-eng wants to merge 1 commit into
developfrom
fix-rule-config-rendering-regression-998574914326561075
Open

Fix Rendering Regression and Race Conditions in RuleConfigModal#218
ruzaqiarkan-eng wants to merge 1 commit into
developfrom
fix-rule-config-rendering-regression-998574914326561075

Conversation

@ruzaqiarkan-eng

Copy link
Copy Markdown
Collaborator

This PR fixes a critical rendering regression in the RuleConfigModal where existing action parameters failed to populate in form fields.

Key changes:

  1. Robust State Cloning: Introduced a deepClone utility in serialization.js that uses structuredClone (with recursive fallback). This replaces the previous JSON.parse(JSON.stringify()) pattern which was stripping away undefined values and breaking Vue's reactivity proxies.
  2. Race Condition Removal: Removed the arbitrary 1000ms setTimeout in useRuleConfig.js used for capturing the initial state. The baseline for dirty checking is now captured immediately upon draft creation, ensuring synchronization with child component lifecycles.
  3. Reactivity Preservation: Systemically updated AssignmentConfig, ConditionBuilder, and various custom controls to use the new cloning utility, restoring the reactivity chain for complex configuration objects.
  4. Targeted Dirty Tracking: Updated useActionConfig to distinguish between draft node updates and global graph updates, preventing the modal from appearing "dirty" prematurely during initial field setup.

These changes ensure that saved rule parameters are correctly hydrated and visually rendered when opening any action node in the builder.


PR created automatically by Jules for task 998574914326561075 started by @ruzaqiarkan-eng

- Added `deepClone` utility in `serialization.js` to preserve `undefined` values and nested structures.
- Replaced reactivity-breaking `JSON.parse(JSON.stringify())` with `deepClone` across rule configuration flow.
- Refactored `useRuleConfig` to capture baseline state immediately, removing a 1000ms race condition.
- Ensured `useActionConfig` internal updates don't trigger global dirty state for draft nodes.
- Improved state hydration stability across all action types.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant