8000 Only decode on onMount to prevent overfetching payloads by Alex-Tideman · Pull Request #2747 · temporalio/ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Only decode on onMount to prevent overfetching payloads #2747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025

Conversation

Alex-Tideman
Copy link
Contributor
@Alex-Tideman Alex-Tideman commented May 29, 2025

Description & motivation 💭

Because our decoder was reactive to value, even though the value didn't change it was still triggered due to JSON.stringify. Moving to onMount will decode only on the mount of component, ensuring it doesn't over-decode. The value shouldn't change - payloads are immutable in history - so onMount should always work. It's more apparent when the workflow is running and we refetch the workflow or get new events in the event history poll.

Screenshots (if applicable) 📸

Before

BeforeDecodeFix.mov

After

AfterDecodeFix.mov

Design Considerations 🎨

Testing 🧪

To test:

Use samples-typescript/encryption project
Add await condition(() => false) before the return results in the workflows.ts to keep the workflow running.

Turn on the codec server. Decode calls should only happen on page load or when new event is rendered. If you sit on the page, it should not re-request codec calls.

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@Alex-Tideman Alex-Tideman requested a review from rossedfort as a code owner May 29, 2025 15:43
Copy link
vercel bot commented May 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 29, 2025 3:43pm

@Alex-Tideman Alex-Tideman merged commit 2f78a89 into main May 29, 2025
20 checks passed
@Alex-Tideman Alex-Tideman deleted the payload-refetch-fix branch May 29, 2025 16:25
Alex-Tideman added a commit that referenced this pull request May 29, 2025
@Alex-Tideman Alex-Tideman restored the payload-refetch-fix branch May 29, 2025 16:27
Alex-Tideman added a commit that referenced this pull request May 29, 2025
@Alex-Tideman Alex-Tideman deleted the payload-refetch-fix branch May 29, 2025 18:43
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.

1 participant
0