fix(cli): stop re-updating unchanged TailorDB types on deploy#1792
Conversation
The platform now returns `optionalOnCreate: false` explicitly on every field config, while locally generated manifests omit the flag. The type diff treated this as a change, so every deploy re-applied every type in the workspace. Normalize `optionalOnCreate: false` to unset at compare time, matching how other known platform defaults are handled.
🦋 Changeset detectedLatest commit: 574b7eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Code Metrics Report (packages/sdk)
Details | | main (d3b5f14) | #1792 (e929a58) | +/- |
|--------------------|----------------|-----------------|-------|
- | Coverage | 74.4% | 74.4% | -0.1% |
| Files | 454 | 454 | 0 |
| Lines | 16897 | 16901 | +4 |
+ | Covered | 12582 | 12584 | +2 |
+ | Code to Test Ratio | 1:0.4 | 1:0.4 | +0.0 |
| Code | 113176 | 113240 | +64 |
+ | Test | 52461 | 52519 | +58 |Code coverage of files in pull request scope (88.0% → 87.7%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
There was a problem hiding this comment.
📖 Docs Quality & Consistency Check
✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.
Checked areas:
- CLI deploy command documentation (
packages/sdk/docs/cli/application.md) - Plan output format and update/create/delete symbols remain accurate - TailorDB service documentation (
packages/sdk/docs/services/tailordb.md) - No changes needed; field definitions are unaffected - Changeset (
tailordb-noop-type-updates.md) - Correctly describes the bug fix as a patch-level change from the user's perspective - AGENTS.md - No updates required; only mentions deploy in passing
- Example code (
example/) - Not affected by this internal change - No
optionalOnCreatereferences in user-facing docs (verified via grep) - correct, as this is an internal field normalization detail
What changed:
This PR fixes a bug where deploy incorrectly marked all TailorDB types as updates on every run, even when nothing changed. The fix normalizes optionalOnCreate: false (returned by the platform) to undefined (how local manifests represent it) during comparison. This is an internal implementation detail that makes the actual behavior match the documented behavior - no documentation changes needed.
Re-run this check by adding the
docs-checklabel to the PR.
| // Platform returns `optionalOnCreate: false` explicitly, while local | ||
| // manifests omit the flag entirely. Treat false as unset so they match. | ||
| if (typeof value === "boolean") { | ||
| if (path.at(-1) === "optionalOnCreate" && value === false) { |
There was a problem hiding this comment.
This same issue was independently fixed on fix/deploy-drift, now opened as → #1797
Hardcoding individual field names like optionalOnCreate isn't great here, since the trigger is a Platform-side change rather than an SDK-side one, so the same class of bug will keep recurring.
#1797 is still being polished, but it absorbs this generically via proto3's zero-value omission rules, so it might be worth reviewing that one instead.
|
Closing in favor of #1797. |
Summary
deploymarked every TailorDB type as an update on every run — even with nolocal changes — because the platform now returns
optionalOnCreate: falseexplicitly while locally generated manifests omit the flag; the type diff now
treats the explicit false as unset, like other known platform defaults.
Before / After
Re-deploying an unchanged project:
~update for every type in the workspace, on every run