Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/visual-editor/src/components/Locator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,11 @@ export const LocatorComponent: ComponentConfig<{ props: LocatorProps }> = {
const entityTypeSourceMap = entityDocument
? getLocatorEntityTypeSourceMap(entityDocument)
: { [DEFAULT_ENTITY_TYPE]: undefined };
console.log("entityDocument:", entityDocument, entityTypeSourceMap);
const entityTypes = Object.keys(
entityTypeSourceMap
) as (keyof typeof entityTypeSourceMap)[];
console.log("entityTypes:", entityTypes);
Comment on lines +882 to +886
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Remove raw debug logging from resolveData before merge.

Line 882 and Line 886 log entityDocument/entity-type resolution data on every reconciliation pass. This can expose internal document payloads in console output and adds unnecessary runtime noise.

Suggested change
-    console.log("entityDocument:", entityDocument, entityTypeSourceMap);
@@
-    console.log("entityTypes:", entityTypes);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log("entityDocument:", entityDocument, entityTypeSourceMap);
const entityTypes = Object.keys(
entityTypeSourceMap
) as (keyof typeof entityTypeSourceMap)[];
console.log("entityTypes:", entityTypes);
const entityTypes = Object.keys(
entityTypeSourceMap
) as (keyof typeof entityTypeSourceMap)[];
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/visual-editor/src/components/Locator.tsx` around lines 882 - 886, In
resolveData, remove the raw console.log calls that output entityDocument and
entityTypeSourceMap/entityTypes (the two console.log lines currently printing
"entityDocument:" and "entityTypes:"); either delete these debug logs or replace
them with a conditional/debug-level logger (e.g., guarded by an isDebug flag or
using a logger.debug) so internal document payloads are not emitted on every
reconciliation pass and runtime noise is reduced. Ensure references to
entityDocument, entityTypeSourceMap, and the derived entityTypes remain
unchanged otherwise.


const previousLocationStyles = data.props.locationStyles ?? [];
const previousResultCard = data.props.resultCard ?? [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ export const InternalLayoutEditor = ({
});

devLogger.logData("RESOLVED_LAYOUT_DATA", resolvedData);

console.log("appState.data:", appState.data);
console.log("Resolved Data:", resolvedData);
Comment on lines +292 to +293
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid logging full editor state via console.log in this path.

Line 292 and Line 293 print full appState.data and resolvedData. That can leak large/sensitive content into browser logs and create noisy output in normal editor usage.

Suggested change
-          console.log("appState.data:", appState.data);
-          console.log("Resolved Data:", resolvedData);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log("appState.data:", appState.data);
console.log("Resolved Data:", resolvedData);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/visual-editor/src/internal/components/InternalLayoutEditor.tsx`
around lines 292 - 293, In InternalLayoutEditor, remove the unconditional
console.log calls that print appState.data and resolvedData; instead either
delete them or replace them with a guarded debug logger (e.g., only log when a
DEBUG flag or logger.isDebugEnabled() is true) and avoid dumping full state by
logging only non-sensitive summaries (IDs, lengths, or hashes) from
appState.data and resolvedData to reduce noise and prevent sensitive data
leakage. Ensure the changes target the console.log("appState.data:",
appState.data) and console.log("Resolved Data:", resolvedData) sites.

if (isDeepEqual(appState.data, resolvedData)) {
devLogger.log(
"reloadDataOnDocumentChange - no layout changes detected"
Expand Down
Loading