Commit 8412cc4
fix(untracked): stream include metadata null after update (#69)
## Root Cause
QuickNode silently removed `include_stream_metadata` from their Streams
API — a breaking change
with no announcement:
| | Before | Now |
|---|---|---|
| GET `/streams/:id` response | returned field | **null** (confirmed via
curl) |
| POST/PATCH request body | accepted | **removed from live OpenAPI
spec** |
| Official docs | documented | **no longer listed** |
Our vendored `streams-openapi.json` still had the field (last
regenerated Feb 2026), causing
the provider to send a field the API no longer accepts and expect a
value the API never returns.
## Failures
### 1. `terraform apply` — "Provider produced inconsistent result after
apply"
Any update to a `quicknode_stream` (e.g. changing `notification_email`)
triggered:
.include_stream_metadata: was cty.StringVal("header"), but now null.
The provider did a GET after the PATCH to refresh state; the absent
field left `null` in the
freshly initialised `StreamResourceModel{}`, overwriting the planned
`"header"`.
### 2. `terraform plan` — phantom diffs on every run
Every `Read()` call overwrote the state value with `null`, queuing a
spurious update
on every plan/apply cycle.
## Changes
| File | Change |
|---|---|
| `api/streams/streams-openapi.json` | Updated from live QuickNode API
(`make vendor`) |
| `api/streams/streams.gen.go` | Regenerated — `IncludeStreamMetadata`
removed from `CreateStreamDto` / `UpdateStreamDto` |
| `internal/provider/stream_resource.go` | Remove field from
Create/Update requests; schema `Required→Optional` + deprecation
warning; fallback in `Read` and post-update `Read` |
### Schema change: `Required` → `Optional` + deprecated
Existing configs that still set `include_stream_metadata = "header"`
will:
- Continue to parse without error (field is Optional)
- Show a deprecation warning during `terraform plan`
- No longer send the value to the API (silently dropped)
- Preserve the existing state value via fallback (no phantom diffs)
Users can remove the field from their configs at their own pace.
## Testing
- `go build ./...` — compiles cleanly
- `go test ./internal/...` — all tests pass
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 88ccbd0 commit 8412cc4
10 files changed
Lines changed: 455 additions & 1152 deletions
File tree
- .github/workflows
- api/streams
- docs/resources
- internal/provider
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
61 | 83 | | |
62 | | - | |
| 84 | + | |
63 | 85 | | |
| 86 | + | |
| 87 | + | |
64 | 88 | | |
65 | 89 | | |
| 90 | + | |
66 | 91 | | |
67 | 92 | | |
68 | 93 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
72 | 99 | | |
73 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
74 | 120 | | |
75 | 121 | | |
76 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
0 commit comments