You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/12/25 14:59:02 UTC

[GitHub] [couchdb-nano] divyanshshekhar opened a new issue, #316: `update_seq` and `purge_seq` are defined as number but in actual response they are string

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: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb-nano] glynnbird closed issue #316: `update_seq` and `purge_seq` are defined as number but in actual response they are string

Posted by GitBox <gi...@apache.org>.
glynnbird closed issue #316: `update_seq` and `purge_seq` are defined as number but in actual response they are string
URL: https://github.com/apache/couchdb-nano/issues/316


-- 
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: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org