kuncevic opened a new issue, #350:
URL: https://github.com/apache/couchdb-nano/issues/350

   I’m using **Nano v10.1.4** with **CouchDB 3.5.0** and observed unexpected 
behavior with 
[nano.db.changesAsStream()](https://github.com/apache/couchdb-nano?tab=readme-ov-file#nanodbchangesasstreamname-params)
   
   ## Steps to Reproduce:
   1. Subscribe to `changesAsStream()` with `doc_ids: ['xyz']`.
   2. Update document `xyz` via `POST`.
   3. Perform a `GET` on document `xyz`.
   4. The stream emits a change for `xyz` (expected).
   5. Immediately after, the stream emits `xyz` again — with the same `_rev` 
and content as you get with the `GET` in step 3 (a side effect here).
   
   ## Observations:
   - The **GET request** caused the document to be emitted again, even though 
the `_rev` did not change.
   - The second emission appears to be a side effect of the `GET` request.
   - If **step 3** (GET) is skipped, only the expected change is emitted.
     
   ## Expected Behavior:
   According to the [CouchDB _changes 
API](https://docs.couchdb.org/en/stable/api/database/changes.html), only 
**write operations** (`PUT`, `POST`, `DELETE`) should trigger events — not 
reads like `GET`.
   
   ## Connection Options:
   
   ```js
   const options: any = {
         since: 'now',
         feed: 'continuous',
         include_docs: true,
   };
   ```
   
   For example, with `feed: 'longpoll'`, the side effect does not occur, which 
is expected as longpoll closes the connection after the first event. I haven't 
tested other feed options yet.
   
   Just trying to get to the bottom of it. Any thoughts?


-- 
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