Skip to content

feat(pubsub): add nack() method to Handler for AtLeastOnce#5261

Open
suzmue wants to merge 1 commit intogoogleapis:mainfrom
suzmue:nackapi
Open

feat(pubsub): add nack() method to Handler for AtLeastOnce#5261
suzmue wants to merge 1 commit intogoogleapis:mainfrom
suzmue:nackapi

Conversation

@suzmue
Copy link
Copy Markdown
Collaborator

@suzmue suzmue commented Apr 3, 2026

Previously, nacking a message in the Pub/Sub subscriber required dropping the handler (drop(h)). While effective, this is less discoverable and readable than an explicit nack(). This change introduces explicit nack() methods to the message handlers for Handler and AtLeastOnce. There is also a private nack() added to ExactlyOnce. Additionally, this change updates the module and method documentation to use the new nack() methods instead of drop().

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Apr 3, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.98%. Comparing base (8cc7ac3) to head (801ff6f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5261      +/-   ##
==========================================
- Coverage   97.98%   97.98%   -0.01%     
==========================================
  Files         215      215              
  Lines       44904    44957      +53     
==========================================
+ Hits        44000    44051      +51     
- Misses        904      906       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suzmue suzmue marked this pull request as ready for review April 3, 2026 21:55
@suzmue suzmue requested a review from a team as a code owner April 3, 2026 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants