fix(serverust-events): SqsBroker não faz ack silencioso sem handler/ARN#12
Merged
Merged
Conversation
… ou ARN Com ReportBatchItemFailures, ausência em batchItemFailures faz a Lambda remover a mensagem como sucesso. Registros sem subscriber ou sem ARN parseável agora entram em batchItemFailures quando há messageId. Tests atualizados; CHANGELOG [Unreleased]. Co-authored-by: Jaime Basso <JaimeJunr@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Risk assessment (automation)
Verdict: Medium–High risk (evidence from diff only).
Why
- Surface:
SqsBroker::handle_sqs_eventinserverust-events— Lambda SQS ESM +ReportBatchItemFailuresbatch handling. - Behavior change: Records without a parseable
event_source_arnor without a registered handler previously produced nobatch_item_failures(implicit success → Lambda could remove messages). They now addbatch_item_failureswhenmessage_idis present, changing retry/DLQ vs silent drop for misconfiguration paths. - Blast radius: Any deployment using this broker with partial batch failure reporting; operational semantics of “success” vs “failure” for edge cases shift (intended correctness fix, still pipeline-level).
- Evidence:
consumer.rscontrol-flow rewrite +sqs_consumer.rsexpectations +CHANGELOG.md.
Review policy: Under the automation rules, Medium+ would require human review (up to 2 reviewers) and would not be eligible for bot self-approval at Medium–High.
Merge state: This pull request is already merged (merged_at present). No reviewer assignment or approval action taken here.
CODEOWNERS: No CODEOWNERS file found in the repository snapshot used for this run.
Sent by Cursor Automation: Assign PR reviewers
This was referenced May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Problema
Com Lambda ESM e
ReportBatchItemFailures, qualquer registro SQS ausente debatchItemFailuresé tratado como sucesso e removido da fila pelo runtime.SqsBroker::handle_sqs_eventignorava mensagens semevent_source_arnparseável ou sem handler para o nome da fila extraído do ARN, devolvendobatchItemFailuresvazio para esses registros. Cenário concreto: typo nosubscribe("orders", …)vs fila realorder, ou payload sem ARN; a função retornava sucesso e as mensagens eram descartadas sem processamento (perda de dados do ponto de vista da aplicação).Correção
messageId, adiciona entrada embatchItemFailurespara retry/DLQ.messageId: mantém o limite anterior (sówarn); a Lambda pode ainda fazer ack — documentado.Validação
cargo +stable test -p serverust-events --features sqscargo +stable clippy -p serverust-events --features sqs --all-targets -- -D warningscargo +stable check --workspaceChangelog
Entrada em
[Unreleased]emCHANGELOG.md.