Skip to content

Conversation

@chelojimenez
Copy link
Contributor

@chelojimenez chelojimenez commented Oct 14, 2025

Note

Move widget data from URL-encoded payloads to server-side storage with new endpoints and client updates to load via toolId.

  • Backend:
    • Server-side widget storage: Add in-memory widgetDataStore with 1h TTL and periodic cleanup.
    • New endpoints: POST /api/mcp/resources/widget/store, GET /api/mcp/resources/widget/:toolId, GET /api/mcp/resources/widget-content/:toolId.
    • Behavior: Fetch widget HTML by toolId; return 404 when missing/expired; add no-cache headers for widget content.
  • Frontend:
    • Renderer update: Replace URL-embedded data with fire-and-forget POST to store widget data; iframe now loads /api/mcp/resources/widget/{toolId}.
    • Minor: Set widgetUrl earlier; remove base64 encoding/query param flow.

Written by Cursor Bugbot for commit f15cf98. This will update automatically on new commits. Configure here.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 14, 2025
setWidgetUrl(url);
}).catch((error) => {
console.error("Error storing widget data:", error);
});
Copy link

Choose a reason for hiding this comment

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

Bug: Race Condition in Widget Data Loading

There's a race condition where the widgetUrl is set immediately, but the widget's data is stored asynchronously via a POST request. This can cause the iframe to try loading the widget before its data is available on the server, leading to a "Widget data not found or expired" error or a 404.

Fix in Cursor Fix in Web

@chelojimenez chelojimenez merged commit 058fdde into main Oct 14, 2025
1 of 2 checks passed
khandrew1 pushed a commit that referenced this pull request Nov 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants