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

   CouchDB has `update_seq` field in response for changes API to identify the 
state of database. However, the actual response in couchdb contains string data 
in the field. For example, is we try to get db (say dbname = 'foo') info from 
couchdb, we get response similar to below:
   ```json
   {
       "db_name": "foo",
       "purge_seq": 
"0-g1AAAABPeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyEhlwqEtkSKqHKMgCAIT2GV4",
       "update_seq": 
"1-g1AAAACLeJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCeexAEmGBiD1HwiyMpgTGXKBAuwp5sZpKZYW6HpwmJLIkFQP1c4I1p6YZmhqYGqIrjgLAA4lKoc",
       "sizes": {
           "file": 20820,
           "external": 14,
           "active": 316
       },
       "props": {},
       "doc_del_count": 0,
       "doc_count": 1,
       "disk_format_version": 8,
       "compact_running": false,
       "cluster": {
           "q": 2,
           "n": 1,
           "w": 1,
           "r": 1
       },
       "instance_start_time": "0"
   }
   ```
   
   ## Expected Behavior
   The following interfaces should have update_seq and purge_seq defined as 
string type:
   - DatabaseGetResponse
   - DocumentListResponse
   - DocumentFetchResponse
   - DocumentFetchRevsResponse
   ## Current Behavior
   The provided interfaces have the `update_seq` and `purge_seq` defined as 
integer which does not match with the datatype in actual response object. It is 
not causing any issues at runtime due to typeless behaviour of Javascript but 
it certainly is a issue when writing our projects as the datatype is ambiguous 
due to mismatch.
   
   ## Possible Solution
   I can raise a PR for the above fix. It should be a simple change. However if 
we change the datatype directly from number to string, it will be a breaking 
change. Also, earlier I believe the response contained actual integers but 
later it changed to string, so I think we can define the datatype to be `number 
| string` instead of `number` that it is currently. This way it won't be a 
breaking change and will also conform to older versions of couchdb.
   
   ## Your Environment
   * Version used: 3.2.2 (docker image)
   


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