Skip to content

fix: clear vue reactive args when nextArgs is empty#34479

Open
oozan wants to merge 1 commit intostorybookjs:nextfrom
oozan:codex/fix-vue-reactive-args-clear-20260407-131323
Open

fix: clear vue reactive args when nextArgs is empty#34479
oozan wants to merge 1 commit intostorybookjs:nextfrom
oozan:codex/fix-vue-reactive-args-clear-20260407-131323

Conversation

@oozan
Copy link
Copy Markdown

@oozan oozan commented Apr 7, 2026

Summary

Fix Vue renderer stale reactive args/globals when nextArgs is empty.

Changes

  • remove the early return in updateArgs
  • add tests to verify empty updates clear reactive args and globals

Closes #34319

Summary by CodeRabbit

  • Bug Fixes
    • Fixed reactive state management when updating with empty argument values. Previously, operations to clear reactive arguments and globals were incorrectly skipped, preventing proper cleanup of existing keys. The renderer now correctly reconciles and removes all reactive properties to maintain proper state synchronization.

Signed-off-by: oozan <oozayranci@gmail.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 56db7704-7315-440a-9759-31527f863661

📥 Commits

Reviewing files that changed from the base of the PR and between 6abc527 and 8ad2645.

📒 Files selected for processing (2)
  • code/renderers/vue3/src/render.test.ts
  • code/renderers/vue3/src/render.ts
💤 Files with no reviewable changes (1)
  • code/renderers/vue3/src/render.ts

📝 Walkthrough

Walkthrough

Modified the Vue3 renderer's updateArgs function to remove an early-return guard that previously skipped reconciliation when nextArgs was empty. The function now always performs key removal and object assignment. Added test cases verifying this behavior clears reactive Args and Globals objects.

Changes

Cohort / File(s) Summary
Vue3 Renderer updateArgs Logic
code/renderers/vue3/src/render.ts
Removed early-return guard when nextArgs has no keys; now always reconciles currentArgs with nextArgs, ensuring deletion of unmatched keys and empty object handling.
Vue3 Renderer Tests
code/renderers/vue3/src/render.test.ts
Added two test cases verifying updateArgs clears reactive Args and Globals objects to {} when nextArgs is empty.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@valentinpalkovic
Copy link
Copy Markdown
Contributor

Hi @oozan,

Due to a recent high volume of unreviewed AI-generated PRs, we are requesting verification and proof that the implemented fix actually works. Please provide a simple GIF/Video or image of how the fix works, optimally with before-and-after comparisons.

Thank you for your understanding!

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

Projects

Status: Human verification

Development

Successfully merging this pull request may close these issues.

Vue: Potential desync bug in reactive globals

2 participants