René's URL Explorer Experiment


Title: fix(workflows): pin a stored block retry policy when loading it by waleedlatif1 · Pull Request #6614 · simstudioai/sim · GitHub

Open Graph Title: fix(workflows): pin a stored block retry policy when loading it by waleedlatif1 · Pull Request #6614 · simstudioai/sim

X Title: fix(workflows): pin a stored block retry policy when loading it by waleedlatif1 · Pull Request #6614 · simstudioai/sim

Description: Summary A single out-of-range value in workflow_blocks.retry makes GET /api/workflows/[id] return 500 forever, bricking the workflow in the editor with no in-product repair. This makes the read tolerant while leaving the write strict. retry is bare jsonb typed as unknown, and load.ts asserted the stored blob was already a BlockRetryConfig: retry: (block.retry as BlockState['retry']) ?? undefined, It then handed that straight to the HTTP boundary, where workflowBlockStateSchema bounds maxTries to 2..5 and waitBetweenTriesMs to 0..5000. That schema is shared between the PUT /state body — where the bound is right — and the GET /api/workflows/[id] and /state responses, where it is fatal. The response .parse in the shared route builder throws a ZodError, which is not an OrchestrationError, so the error policy declines it and it falls through to a 500. Every UI write path reads the workflow first, so there is no way to fix the row from inside the product. The fix constructs a real BlockRetryConfig from the blob using the feature's own normalizeBlockRetryTries / normalizeBlockRetryWaitMs, filling defaults for missing fields and carrying enabled across unchanged. This lands ahead of the data. The retry column itself is brand new — migration 0288_workflow_blocks_retry landed two days ago in #6458 — so this is a pre-emptive guard arriving essentially alongside the column, not a repair of existing rows. That is the ideal time to add it: once a row goes out of range, the workflow is unopenable and there is no in-product way to fix it. Why the read is the right seam loadWorkflowFromNormalizedTablesRaw is the single read choke point for both apps — @sim/workflow-persistence for the Next app and the realtime server's full-state emit — so one edit covers every reader, and a normalized row self-heals on the next save. It matches clampParallelBatchSize a few lines below, which already pins a stored subflow value on the same path. The feature already declares clamp-on-read as its contract: the TSDoc on resolveBlockRetryConfig says bounds are clamped on read rather than rejected, and block-retry.test.ts asserts it. Execution has always honoured that. Only the read boundary disagreed. Six writers persist this column without bounding it: workflow:batch-add-blocks, workflow:replace-state, and workflow:update-block-retry on the realtime server — the first two take untyped block records v1/admin/workflows/import, v1/admin/workspaces/[id]/import, and superuser/import-workflow, which persist externally-authored workflow JSON server-side "Doesn't this silently change a value the user configured?" No — it makes the UI stop lying. The executor already clamps: resolveBlockRetryConfig pins the same bounds before a retry runs. Before this change, a block storing maxTries: 999 displayed 999 in the editor while execution ran 5. Now the editor shows 5, which is what actually happens. The displayed value and the executed value agree for the first time. enabled is carried across rather than resolved, so the numbers a builder configured survive switching retry off and back on. Alternatives rejected Validating on write. Leaves every existing bad row fatal forever, and would have to be repeated across three realtime ops plus roughly a dozen saveWorkflowToNormalizedTables callers, none of which share a validation seam. Bounding BlockRetrySchema in @sim/realtime-protocol. Its own TSDoc is correct that batch-add and replace-state bypass it, so this closes one writer and leaves the 500. Relaxing the response contract. Stops the 500 but leaves the editor rendering a number execution will never run. A contract test now pins the write bound so this shortcut fails loudly. Reusing resolveBlockRetryConfig. It returns null for a disabled policy, so it would erase the numbers a builder configured on every read. A dedicated test pins the opposite behavior. Type of Change Bug fix Testing Six cases in packages/workflow-persistence/src/load.test.ts, four of which are red without the load.ts change (verified by reverting the file and re-running): out-of-range enabled policy pinned to the bounds out-of-range disabled policy pinned without being discarded — the case that would let a resolveBlockRetryConfig-based patch ship green and be wrong missing fields filled with defaults non-boolean enabled resolved the way execution reads it in-range policy left untouched NULL reported as no policy (block runs once) Plus a contract test in apps/sim/lib/api/contracts/workflows.test.ts that the write bound still rejects out-of-range input. bun run type-check clean in apps/sim and packages/workflow-persistence; bun run check:api-validation passes; biome clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary A single out-of-range value in workflow_blocks.retry makes GET /api/workflows/[id] return 500 forever, bricking the workflow in the editor with no in-product repair. This makes the read tol...

X Description: Summary A single out-of-range value in workflow_blocks.retry makes GET /api/workflows/[id] return 500 forever, bricking the workflow in the editor with no in-product repair. This makes the read tol...

Opengraph URL: https://github.com/simstudioai/sim/pull/6614

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:aad6540f-660a-3d7d-f91f-55cb4dd45b02
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9066:3ED756:28D605:38FF11:6AFB5309
html-safe-noncea8dcaaecaddde5573f720ada73ee58cff578ebd63343514c0c0b0129a13f0317
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDY2OjNFRDc1NjoyOEQ2MDU6MzhGRjExOjZBRkI1MzA5IiwidmlzaXRvcl9pZCI6IjQzNzU0NTE5NDQwODUwNTAxMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccac02ef74da74a58b2eabcc3aa9ae64b1e2828a371b1c161899640f1771daa6a
hovercard-subject-tagpull_request:4260590252
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6614/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary A single out-of-range value in workflow_blocks.retry makes GET /api/workflows/[id] return 500 forever, bricking the workflow in the editor with no in-product repair. This makes the read tol...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/6614/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6614%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6614%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/6614/files
Reloadhttps://github.com/simstudioai/sim/pull/6614/files
Reloadhttps://github.com/simstudioai/sim/pull/6614/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/w1-block-retry-normalizationhttps://github.com/simstudioai/sim/tree/fix/w1-block-retry-normalization
Conversation 3 https://github.com/simstudioai/sim/pull/6614
Commits 1 https://github.com/simstudioai/sim/pull/6614/commits
Checks 31 https://github.com/simstudioai/sim/pull/6614/checks
Files changed https://github.com/simstudioai/sim/pull/6614/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6614/files
fix(workflows): pin a stored block retry policy when loading it https://github.com/simstudioai/sim/pull/6614/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/6614/files
bfcec6e fix(workflows): pin a stored block retry policy when loading it waleedlatif1 Aug 12, 2026 https://github.com/simstudioai/sim/pull/6614/commits/bfcec6e759f27e854070c642f2e4971d10feb429
Clear filters https://github.com/simstudioai/sim/pull/6614/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6614/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6614/files
workflows.test.ts https://github.com/simstudioai/sim/pull/6614/files#diff-ad98890884605487fbf54889ea89ce46d9ce93d8b7e6cdbb2145bf3854ae4984
load.test.ts https://github.com/simstudioai/sim/pull/6614/files#diff-6e052addd08321997f3ef1051d5489ef3302a7f195f863af13fc012078ffe72e
load.ts https://github.com/simstudioai/sim/pull/6614/files#diff-9a0b22191731c8780fe61e3691961713927c998585466a156448b11778704ddd
apps/sim/lib/api/contracts/workflows.test.tshttps://github.com/simstudioai/sim/pull/6614/files#diff-ad98890884605487fbf54889ea89ce46d9ce93d8b7e6cdbb2145bf3854ae4984
View file https://github.com/simstudioai/sim/blob/bfcec6e759f27e854070c642f2e4971d10feb429/apps/sim/lib/api/contracts/workflows.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6614/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6614/files#diff-ad98890884605487fbf54889ea89ce46d9ce93d8b7e6cdbb2145bf3854ae4984
https://github.com/simstudioai/sim/pull/6614/files#diff-ad98890884605487fbf54889ea89ce46d9ce93d8b7e6cdbb2145bf3854ae4984
https://github.com/simstudioai/sim/pull/6614/files#diff-ad98890884605487fbf54889ea89ce46d9ce93d8b7e6cdbb2145bf3854ae4984
packages/workflow-persistence/src/load.test.tshttps://github.com/simstudioai/sim/pull/6614/files#diff-6e052addd08321997f3ef1051d5489ef3302a7f195f863af13fc012078ffe72e
View file https://github.com/simstudioai/sim/blob/bfcec6e759f27e854070c642f2e4971d10feb429/packages/workflow-persistence/src/load.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6614/{{ revealButtonHref }}
packages/workflow-persistence/src/load.tshttps://github.com/simstudioai/sim/pull/6614/files#diff-9a0b22191731c8780fe61e3691961713927c998585466a156448b11778704ddd
View file https://github.com/simstudioai/sim/blob/bfcec6e759f27e854070c642f2e4971d10feb429/packages/workflow-persistence/src/load.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6614/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6614/files#diff-9a0b22191731c8780fe61e3691961713927c998585466a156448b11778704ddd
https://github.com/simstudioai/sim/pull/6614/files#diff-9a0b22191731c8780fe61e3691961713927c998585466a156448b11778704ddd
https://github.com/simstudioai/sim/pull/6614/files#diff-9a0b22191731c8780fe61e3691961713927c998585466a156448b11778704ddd
https://github.com/simstudioai/sim/pull/6614/files#diff-9a0b22191731c8780fe61e3691961713927c998585466a156448b11778704ddd
Please reload this pagehttps://github.com/simstudioai/sim/pull/6614/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.