Skip to content

fix: handle empty data-cslp attributes in getEntryIdentifiersInCurrentPage function#528

Merged
hiteshshetty-dev merged 3 commits intodevelop_v4from
VB-576
Dec 1, 2025
Merged

fix: handle empty data-cslp attributes in getEntryIdentifiersInCurrentPage function#528
hiteshshetty-dev merged 3 commits intodevelop_v4from
VB-576

Conversation

@hiteshshetty-dev
Copy link
Copy Markdown
Contributor

Title

Publish modal doesn’t load in Visual Builder

Description

If the website contains any DOM node with an empty CSLP element, the Page Status, Sidebar Rails, or Publish Modal may fail to load. This occurs because our logic for extracting all elements on the website crashes in such cases, causing the postMessage flow to break and preventing these screens from loading.
We are addressing this by adding proper handling for empty CSLP elements to avoid extraction failures.

Before:

Screen.Recording.2025-11-25.at.5.36.43.PM.mov

After:

Screen.Recording.2025-11-25.at.5.35.06.PM.mov

@hiteshshetty-dev hiteshshetty-dev requested a review from a team as a code owner November 25, 2025 12:07
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 25, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 72.62% 9545 / 13142
🔵 Statements 72.62% 9545 / 13142
🔵 Functions 71.51% 339 / 474
🔵 Branches 84.32% 1221 / 1448
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/visualBuilder/components/fieldLabelWrapper.tsx 69.94% 58.33% 72.72% 69.94% 48-50, 58-60, 144-157, 160-164, 183-212, 225-256, 281-282, 286-291, 295, 360-362, 368-386, 391-403
src/visualBuilder/generators/generateOverlay.tsx 90.62% 84.61% 100% 90.62% 131-140, 198-201, 226-229
src/visualBuilder/utils/getCsDataOfElement.ts 100% 100% 100% 100%
src/visualBuilder/utils/getEntryIdentifiersInCurrentPage.ts 100% 100% 100% 100%
src/visualBuilder/utils/getVisualBuilderRedirectionUrl.ts 100% 100% 100% 100%
src/visualBuilder/utils/updateFocussedState.ts 57.1% 64.4% 100% 57.1% 45, 57-59, 61-63, 65, 208-211, 213-244, 334-338, 341-358, 361-371, 374-391, 400-445, 452-474, 480-482
Generated in workflow #658 for commit ba91cb0 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

@csAyushDubey csAyushDubey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added two comments

Comment thread src/visualBuilder/utils/getEntryIdentifiersInCurrentPage.ts
Copy link
Copy Markdown
Contributor

@csAyushDubey csAyushDubey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hiteshshetty-dev hiteshshetty-dev merged commit 9000f02 into develop_v4 Dec 1, 2025
10 checks passed
@hiteshshetty-dev hiteshshetty-dev deleted the VB-576 branch December 1, 2025 04:35
@hiteshshetty-dev hiteshshetty-dev restored the VB-576 branch December 1, 2025 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants