Commit e8358a7
types(core): reject the removed
`messageTypeField` was removed in core 25.x in favor of
`messageTypeResolver`. Until now the option was simply absent from
`CommonQueueOptions`, but TypeScript's excess-property checks are
weakened across the long `Omit`/`&`/generic chains used by publisher
options (`SnsPublisherManager.newPublisherOptions` etc.), so callers
who hadn't migrated were silently passing a no-op option.
The runtime impact is severe and silent: with payload offloading
enabled, the offload step in `AbstractQueueService` only preserves the
message `type` field on the offloaded body when `messageTypeResolver`
is configured. Callers still on `messageTypeField` end up publishing
SNS messages without `type` in the body, and any subscription with
`FilterPolicyScope: 'MessageBody'` filtering on `type` silently drops
the message before SQS delivery. Production-confirmed against
file-storage-service after its 24.x → 25.x bump.
Type the field as `?: never` with deprecation guidance so it now
fails compilation with a clear error pointing at the migration. Add
type-level guards in core and sns test suites that lock the contract
in place.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>messageTypeField option at compile time1 parent c78b37c commit e8358a7
3 files changed
Lines changed: 83 additions & 0 deletions
File tree
- packages
- core
- lib/types
- test/types
- sns/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments