POST to _changes times out if a POST body is present and the "filter" query parameter is set to something other than _doc_ids
- Dominant language
- Erlang
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 9
Description
Refer : https://issues.apache.org/jira/browse/COUCHDB-3373
## Expected Behavior
```
> curl -X POST -H 'Content-Type: application/json' 'http://localhost:5984/couchbase-test-notes/_changes?feed=normal&style=all_docs&filter=filterFuncs/ownerFilter&owner=Gunderson'
{"results":[
{"seq":"7-g1AAAAB5eJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuRAY-iPBYgydAApP6D1GYwJ7LnAgXYk1LMUg2S0rDpywIA-MYnAQ","id":"Gunderson-ThrowAway-faafcfac-4942-4c72-a6c3-27a0c3f68183","changes":[{"rev":"3-bf8d32e5dbc3417d737e6d1146da1879"}],"deleted":true},
.
.
.
],
"last_seq":"81-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOVEmFyjAnmiZlmqalIZNAx5j8liAJEMDkPoPNc0UbFpSilmqAXbTsgC8KjHi","pending":0}
```
## Current Behavior
{"error":"error","reason":"timeout"}
## Steps to Reproduce (for bugs)
If the filter is anything other than _docs_ids and Request type is POST, request timed out error is thrown
```
curl -X POST \
'http://localhost:5984/db/_changes?filter=syncFilters/channel-filter' \
-H 'Authorization: Basic ZGhxLWFkbWluOno0NlprOUxkV3Y1VXNkcU0=' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: ab4cd8bd-b1c9-4a4a-a181-6163266ec426' \
-d '{
"channel_id": 108
}'
```
## Context
I want to pass the filter params in POST body, since GET body has size limitation. My filter param is very lengthy hence I am using POST request with _changes endpoint
## Your Environment
* Version used: 2.1.1
* Operating System and version (desktop or mobile): Ubuntu
Contributor guide
Research direction
Start by reproducing the POST request against the _changes endpoint with a non-_doc_ids filter and a JSON body, using the curl examples in the issue. Trace the _changes request path and filter handling; done means the request returns the expected changes response instead of timing out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- erlang
- Domain
- api, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100