Title: fix(deploy): resolve subblock values to their configuration on both sides of change detection by icecrasher321 · Pull Request #6984 · simstudioai/sim · GitHub
Open Graph Title: fix(deploy): resolve subblock values to their configuration on both sides of change detection by icecrasher321 · Pull Request #6984 · simstudioai/sim
X Title: fix(deploy): resolve subblock values to their configuration on both sides of change detection by icecrasher321 · Pull Request #6984 · simstudioai/sim
Description: Focusing a deployed trigger block flips the deploy button Live → Update for a change nobody made, and redeploying cannot clear it. Deploy materializes every declared defaultValue into webhook.providerConfig (getConfigValue). Opening the block's panel reads that derived artifact back into live state through a non-persisting setValue, so the block gains keys the DB draft does not have. Because deploy snapshots the draft, the next deployment lacks them too — a fixpoint. Measured on production Recent generic_webhook deployments missing acceptOtherMethods 89 / 89 (100%) Active webhooks with a providerConfig key their block lacks 1,046 / 2,139 (49%) Replay over 185 real webhook workflows with the panel-focus read-back simulated: flipped "Update" -> "Live": 78 (42% of the sample) flipped "Live" -> "Update": 0 OK: no workflow reports a field it did not report before. 77 verifyTestEvents \ 35 acceptOtherMethods | generic webhook 35 exposeRequestHeaders | 16 responseMode / 7 consecutiveFailures \ 7 costThresholdCredits | a monitoring trigger family — 7 durationThresholdMs | same bug, never reported 7 errorCountThreshold | 7 failureRatePercent | 7 inactivityHours | 7 latencySpikePercent | 7 windowHours / 5 includeFiles Slack 1 dateTimeRenderOption Google Sheets Four trigger families, not one. Every bucket is a defaulted field; none resembles a swallowed user edit. A separate replay over 60 ordinary (non-trigger) workflows — 9 of which reported real changes — produced byte-identical output before and after. The tenth instance of one failure mode 3c29476604 · 41b68048a5 · 066e18ac28 · 4f722c6439 · 5ece9f9e7e · ff23546f30 · 01577a18b4 · 3cc9b1ae56 · 88065088bf are all the same shape: two pipelines spelled one configuration differently, found in production, patched with a per-field exception. normalize.ts had grown to 16 excluded data fields, 10 filtered subblock ids, 7 dropped block fields and 8 bespoke sanitizers. The fix Resolve each subblock to the configuration it represents, from the current block definition, applied to both sides. Absent, null, and — where a default is declared — '' all mean unset, as does a value equal to that default. Adding a defaulted field to a block definition becomes a no-op for deployed workflows instead of a retroactive diff. Comparison-time only, deliberately. Writing defaults into storage answers the same question but cannot be rolled back, and would destroy the "key absent means this state predates the field" signal the subblock-rename migrations depend on (subblock-migrations.ts:366-390). value() is not consulted — those thunks are generators, so resolving one makes a state unequal to itself. Canonicalization lives inside generateWorkflowDiffSummary, so no caller can bypass it. No branded type: it would guard the wrong thing (operand shape, when the failure is operand provenance). Two bugs found while validating, fixed here Server and client disagreed. deployment-status.ts compared the raw version jsonb while the client's /deployed endpoint compares a materialized one. Both now go through materializeDeploymentState, and checkNeedsRedeployment owns both loads so mismatched operands are unrepresentable. The button already flickered. getButtonLabel() never read isChangeDetectionSettling — it only reached the tooltip — and change detection returns false while loading. Every page load rendered Live → Update; because isFetching was passed too, every window focus rendered Update → Live → Update. Now an explicit status seeded from the server's needsRedeployment, which the component already fetched and threw away. Regression net provider-config-round-trip.test.ts asserts over 417 real (blockType, triggerId) pairs that stored → providerConfig → read back is invisible to change detection, in both spellings of unset. It found a genuine bug in this PR's own first draft: Gmail declares includeAttachments twice — as an action switch with no default, and via its poller spread with defaultValue: false — so "first declaration wins" picked the wrong one. Specs are now mode-aware. reported-bug.test.ts keeps the originally reported workflow verbatim, including the exact spelling mix that produced it. Performance Faster, not slower: 1.282ms → 1.101ms per diff on a 55-block workflow. Removing the always-equal .properties comparison more than pays for the spec lookup. Reviewer notes compare.ts is −292 lines. The ${subId}.properties change class is deleted: it compared {id} against {id}, and when it did fire it counted toward hasChanges while the description filtered it out — "changes detected, nothing to show". compare.ts no longer imports resolve-values.ts (moved to describe.ts), so deployment-status.ts and snapshot/service.ts stop pulling @/blocks/registry, @/hooks/selectors/registry and @tanstack/react-query for functions they never call. comparison/index.ts must not re-export describe.ts — apps/sim has no sideEffects: false. stores/AGENTS.md and the subblock store docstring documented normalizeTriggerConfigValues as the compensation for populateTriggerFieldsFromConfig. It never could compensate — it back-fills from a side's own persisted triggerConfig aggregate, nothing has persisted one since the modal-era migration, and it only fills keys that already exist. Corrected here. The two scripts under apps/sim/scripts/ are the reproducible evidence. dump-change-detection-states.ts scrubs credential-shaped values by default and needs --out (the loader logs to stdout and would corrupt the JSONL). Not in this PR No live-browser verification of the flicker. The state machine is unit-tested; React Query's actual isLoading/isFetching transition ordering is not. Worth a manual pass before merge. The CI ratchet (check-subblock-persistence.ts) that would make a non-persisting subblock write hard to add by accident. Four dead-code candidates left in place with reasons, chiefly normalizeTriggerConfigValues itself: it is dead on the modern path, but for a legacy workflow with a one-sided persisted aggregate, deleting it could add a diff. That is a replay-harness decision, not a reasoning one. Canonical-pair collapse, and the five divergent creation-time seeding implementations. Both change what is compared or persisted, so neither belongs in a backwards-compatible change. 🤖 Generated with Claude Code
Open Graph Description: Focusing a deployed trigger block flips the deploy button Live → Update for a change nobody made, and redeploying cannot clear it. Deploy materializes every declared defaultValue into webhook.provi...
X Description: Focusing a deployed trigger block flips the deploy button Live → Update for a change nobody made, and redeploying cannot clear it. Deploy materializes every declared defaultValue into webhook.provi...
Opengraph URL: https://github.com/simstudioai/sim/pull/6984
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:489685b0-aed1-e913-7296-bb2634e98023 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 84D6:303206:835EFB:B9E160:6AFB4C95 |
| html-safe-nonce | 21d15cb6c67e528a55f797781ee4a7ee195337ccb7790aa87d4e536cd7799571 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEQ2OjMwMzIwNjo4MzVFRkI6QjlFMTYwOjZBRkI0Qzk1IiwidmlzaXRvcl9pZCI6Ijc0MTUyNjI2NDAzNjE2NTU0NDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e5e56c27444fe1cd0c0917fc7484fe3f37b2177ddd50f464d0df9dc5c93db350 |
| hovercard-subject-tag | pull_request:4339642157 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6984/files |
| twitter:image | https://avatars.githubusercontent.com/u/17950982?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/17950982?s=400&v=4 |
| og:image:alt | Focusing a deployed trigger block flips the deploy button Live → Update for a change nobody made, and redeploying cannot clear it. Deploy materializes every declared defaultValue into webhook.provi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | acf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26504db649b58525278f77a52b80ba5f10d5f4de |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width