Conversation
commit: |
|
Warning: Component files have been updated but no migrations have been added. See https://github.com/yext/visual-editor/blob/main/packages/visual-editor/src/components/migrations/README.md for more information. |
WalkthroughTwo files were modified to add debugging logging statements. In Suggested reviewers
🚥 Pre-merge checks | ❌ 2❌ Failed checks (2 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/visual-editor/src/components/Locator.tsx`:
- Around line 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.
In `@packages/visual-editor/src/internal/components/InternalLayoutEditor.tsx`:
- Around line 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.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b4e6c2c7-049c-4c66-808a-9fa0b07d4418
📒 Files selected for processing (2)
packages/visual-editor/src/components/Locator.tsxpackages/visual-editor/src/internal/components/InternalLayoutEditor.tsx
| console.log("entityDocument:", entityDocument, entityTypeSourceMap); | ||
| const entityTypes = Object.keys( | ||
| entityTypeSourceMap | ||
| ) as (keyof typeof entityTypeSourceMap)[]; | ||
| console.log("entityTypes:", entityTypes); |
There was a problem hiding this comment.
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.
| 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.
| console.log("appState.data:", appState.data); | ||
| console.log("Resolved Data:", resolvedData); |
There was a problem hiding this comment.
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.
| 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.
No description provided.