allthingssecurity opened a new pull request, #27322:
URL: https://github.com/apache/camel/pull/27322

   # Description
   
   [CAMEL-25290](https://issues.apache.org/jira/browse/CAMEL-25290)
   
   `CouchDbConsumer` applied its `deletes`/`updates` filters only when 
`ChangesResultItem.isDeleted()` was not null. CouchDB sets `deleted` only on 
the changes of deleted documents, so for inserts and updates it is null: 
`updates=false` published every insert and update anyway. A change skipped by a 
filter also did not advance `since`; when a whole page of changes 
(`maxMessagesPerPoll`, 10 by default) is skipped, for example after deleting 10 
documents with `deletes=false`, every poll asked for the same page again and 
the consumer never saw a later change.
   
   Both are regressions of CAMEL-20800 (4.7.0): LightCouch's `Row.isDeleted()` 
was a primitive `boolean`, and its continuous feed never asked for the same 
changes again.
   
   This change: a missing `deleted` means not deleted, and a skipped change 
moves `since` past it like a processed one (it was skipped on purpose, so 
nothing is lost).
   
   Tests:
   - `CouchDbConsumerFilterTest` (new, mocked `CouchDbClientWrapper`, changes 
parsed from JSON with the Cloudant SDK): a page of deleted documents with 
`deletes=false` (the next poll must start after it), `updates=false` with an 
update and a delete, and a control with both published.
   - Without the change 2 fail (the second poll asks again from `0`; `expected: 
<1> but was: <2>`); the control passes.
   - With the change the module suite passes (16 unit tests; the IT needs 
Docker).
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
     (I built and tested the affected module, including the formatter and 
import-sort plugins. I did not run the full root build.)
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
     This PR was prepared with Claude Code (Claude Opus 5.5). The commit 
carries a `Co-Authored-By` trailer.
   
   _Claude Code on behalf of allthingssecurity_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to