Repository navigation
Commit 66fdc28
committed
fix: extract SNS dsm context in mixed eventbridge/SNS sqs batches
When EventBridge and SNS are both routed to the same SQS queue and their
messages are batched into a single event payload, the SNS DSM context was
dropped.
_dsm_set_eventbridge_sqs_batch_checkpoints classifies every record in the
batch and falls back to _extract_sqs_record_message_attribute_context for
non-EventBridge records. That helper only read record.messageAttributes and
never unwrapped an SNS notification carried in the SQS body (an SNS => SQS
subscription without raw message delivery), so the SNS carrier resolved to
None. Because the batch contained an EventBridge delivery, dsm_handled was
True for the whole batch and the SNS-aware fallback path further down in
extract_context_from_sqs_or_sns_event_or_context never ran.
Teach the helper to unwrap the SNS envelope the same way the main SQS/SNS
extraction path already does, so each record in a mixed batch is classified
correctly regardless of whether it is a direct SQS send or an SNS delivery.
The shared attribute decoding and envelope detection are factored out into
_decode_dd_message_attribute and _parse_sns_notification_from_sqs_body.1 parent fd813a3 commit 66fdc28
2 files changed
Lines changed: 96 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
530 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
531 | 574 | | |
532 | 575 | | |
533 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4103 | 4103 | | |
4104 | 4104 | | |
4105 | 4105 | | |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | + | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
4106 | 4157 | | |
4107 | 4158 | | |
4108 | 4159 | | |
| |||
0 commit comments