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

fix(rsc): prevent draft content leaks in visual editor #1337

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

edodusi
Copy link
Contributor

@edodusi edodusi commented Feb 6, 2025

Description:

This PR fixes a potential security issue where draft content could leak between requests in the visual editor. It also improves type safety and optimizes visual editor detection.

Key changes:

  • Cache cleanup after story retrieval to prevent content leaks
  • Optimized Visual Editor detection logic

Testing:
Changes have been tested in local environment with visual editor. Additional integration tests are planned.

- Add proper cleanup of story cache after use
- Improve type safety in live editing components
- Optimize visual editor detection logic
- Add defensive initialization of global story cache
@edodusi edodusi added the bugfix [PR] Fixes a bug label Feb 6, 2025
alexjoverm
alexjoverm previously approved these changes Feb 7, 2025
@alexjoverm
Copy link
Contributor

Great job @edodusi , fixed it perfectly 👌

alvarosabu
alvarosabu previously approved these changes Feb 7, 2025
@edodusi edodusi dismissed stale reviews from alvarosabu and alexjoverm via 786d6a8 February 7, 2025 09:24
Copy link

pkg-pr-new bot commented Feb 7, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@storyblok/react@1337

commit: 786d6a8

@edodusi edodusi merged commit fd3d9e4 into main Feb 7, 2025
8 checks passed
@edodusi edodusi deleted the fix/global-story-cache branch February 7, 2025 09:26
Copy link
Contributor

github-actions bot commented Feb 7, 2025

🎉 This PR is included in version 4.3.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix [PR] Fixes a bug released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants