Skip to content

Comments

Template content duplication#188

Closed
danilowoz wants to merge 1 commit intomainfrom
cursor/template-content-duplication-34fd
Closed

Template content duplication#188
danilowoz wants to merge 1 commit intomainfrom
cursor/template-content-duplication-34fd

Conversation

@danilowoz
Copy link
Member

@danilowoz danilowoz commented Feb 20, 2026

Add investigation documents and a Python reproduction script to detail the dashboard template editor's HTML transformation and duplication bug.

This PR provides comprehensive documentation and a reproducible example for an issue where the dashboard editor incorrectly transforms and persists HTML content upon viewing a template, leading to content bloat and duplication. The actual fix will need to be implemented in the dashboard's codebase.


Slack Thread

Open in Web Open in Cursor 


Summary by cubic

Adds a detailed investigation and a Python repro script for the dashboard template editor bug that rewrites and duplicates HTML on view. This supports Linear PRODUCT-1427 by documenting root cause and providing a repeatable test.

  • New Features
    • INVESTIGATION_TEMPLATE_HTML_TRANSFORMATION.md: Root cause (dashboard auto-saves React Email–transformed HTML), evidence, proposed fixes, and verification steps.
    • TEMPLATE_ISSUE_README.md: Quick links and TL;DR for the issue.
    • examples/investigation_template_transformation.py: Repro script that creates a template, prompts a dashboard view to trigger mutation, verifies bloat/duplication, and cleans up (usage: set RESEND_API_KEY and run the script).

Written for commit c2d8680. Summary will update on new commits.

… issue

- Document root cause: dashboard auto-saves React Email transformed HTML
- Identify source: React Email components add data-id attributes
- Create Python reproduction script matching Node.js investigation
- Propose 4 solutions with recommended fix
- Confirm SDK is working correctly, issue is platform-side

Related: #186, #187, PRODUCT-1427

Co-authored-by: Danilo Woznica <danilowoz@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 20, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 3 files

Confidence score: 3/5

  • Moderate risk due to a missing reminder to verify production API key permissions for newly added SDK methods, which could lead to permission-related failures in real deployments
  • The issue is localized to documentation/examples and doesn’t imply a code crash, but it can impact users configuring production access
  • Pay close attention to examples/investigation_template_transformation.py - add or highlight the API key permission reminder for the new template methods.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="examples/investigation_template_transformation.py">

<violation number="1" location="examples/investigation_template_transformation.py:195">
P2: Custom agent: **API Key Permission Check SDK Methods**

New third-party SDK methods (Templates create/get/update/remove) are introduced without a reminder to confirm production API key permissions, which the rule explicitly requires for new SDK operations. Add a note to verify keys have template read/write/delete access before use.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

"html": COMPLEX_HTML,
}

created = resend.Templates.create(create_params)
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: Custom agent: API Key Permission Check SDK Methods

New third-party SDK methods (Templates create/get/update/remove) are introduced without a reminder to confirm production API key permissions, which the rule explicitly requires for new SDK operations. Add a note to verify keys have template read/write/delete access before use.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At examples/investigation_template_transformation.py, line 195:

<comment>New third-party SDK methods (Templates create/get/update/remove) are introduced without a reminder to confirm production API key permissions, which the rule explicitly requires for new SDK operations. Add a note to verify keys have template read/write/delete access before use.</comment>

<file context>
@@ -0,0 +1,320 @@
+        "html": COMPLEX_HTML,
+    }
+
+    created = resend.Templates.create(create_params)
+    template_id = created["id"]
+    print(f"Created template ID: {template_id}")
</file context>

@danilowoz danilowoz closed this Feb 20, 2026
@danilowoz danilowoz deleted the cursor/template-content-duplication-34fd branch February 20, 2026 17:08
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.

2 participants