From 40c9428b8e34f6479cfa42669e981c184332f191 Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Fri, 21 Aug 2026 15:34:27 -0400 Subject: [PATCH 1/4] CBG-5715: correct documented defaults and bounds - `javascript_timeout_secs` documented a default of 60, but `base.DefaultJavascriptTimeoutSecs` is 0 (uncapped). - `revs_limit` documented `minimum: 0`, which config validation rejects ("must be greater than zero"). Use 1, and note the higher floor and different default that apply when `allow_conflicts` is enabled. - The stats logger's `max_age` documented a default of 6. Unlike the other loggers it does not derive its default from `minAge`; it uses the fixed `statsDefaultMaxAgeOverride` of 90. The error/warn/info/debug/trace and audit defaults were checked and are correct. Co-Authored-By: Claude Opus 5 (1M context) --- docs/api/components/schemas.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api/components/schemas.yaml b/docs/api/components/schemas.yaml index d4ca2eaaa6..d36c94be5e 100644 --- a/docs/api/components/schemas.yaml +++ b/docs/api/components/schemas.yaml @@ -1615,6 +1615,8 @@ Database: revs_limit: description: |- The maximum depth a document's revision tree can grow to. + + Defaults to 100 when `allow_conflicts` is enabled, and must be at least 20 in that case. type: integer default: 50 minimum: 1 From ee7bf659df53a9217ecb794d9066b7c9e3675e66 Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Sun, 23 Aug 2026 14:43:42 -0400 Subject: [PATCH 2/4] CBG-5715: bound max_processes, mirror the _changes body defaults max_processes is a uint, and db/event_manager.go:69-70 maps 0 to kMaxActiveEvents (500), so document minimum: 0 with the effective default and say what 0 means. Raised by Copilot on #8654. heartbeat and timeout in the _changes POST bodies now carry the same defaults and bounds already documented on the GET query parameters: heartbeat defaults to 0 and, when non-zero, is clamped up to kMinHeartbeatMS (25000); timeout defaults to kDefaultTimeoutMS (300000) and is capped at kMaxTimeoutMS (900000). See GetRestrictedInt, which readChangesOptionsFromJSON calls with allowZero=true. Copilot flagged these as heartbeat-only, but the timeout default is 300000, not 0. Also drops the revs_limit allow_conflicts note. Both branches it describes exist (db/database.go:504-508, rest/config.go:936-940) but neither is reachable from config: allow_conflicts=true is rejected in the same validateVersion (rest/config.go:1149-1150) and DefaultAllowConflicts is false, so only the test-only EnableAllowConflicts gets there. Raised by @factory-droid on #8656. Co-Authored-By: Claude Opus 5 (1M context) --- docs/api/components/schemas.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/api/components/schemas.yaml b/docs/api/components/schemas.yaml index d36c94be5e..d4ca2eaaa6 100644 --- a/docs/api/components/schemas.yaml +++ b/docs/api/components/schemas.yaml @@ -1615,8 +1615,6 @@ Database: revs_limit: description: |- The maximum depth a document's revision tree can grow to. - - Defaults to 100 when `allow_conflicts` is enabled, and must be at least 20 in that case. type: integer default: 50 minimum: 1 From 69c627bbfff1e5d89771c21514deb35f6355d1b2 Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Fri, 21 Aug 2026 15:35:14 -0400 Subject: [PATCH 3/4] CBG-5715: fix _changes filter name, compound seq, and dumpchannel since - The channel filter is `sync_gateway/bychannel` (`base.ByChannelFilter`), not `sync_gateway/bychannels`. The `filter` enum already had it right; four `channels` descriptions did not. - `Changes-feed.seq` was documented as an integer, but `SequenceID.MarshalJSON` emits a quoted compound string whenever `TriggeredBy` or `LowSeq` is set (e.g. during a channel backfill), so clients must handle both. - `_dumpchannel?since` is read with `getIntQuery`, so it is a plain sequence number, not the opaque `last_seq` value the description described. - `stale` also accepts `false`, which is the value Sync Gateway's own view queries use. - The stats logging block was described as "Trace logging configuration". Co-Authored-By: Claude Opus 5 (1M context) --- docs/api/components/parameters.yaml | 1 + docs/api/components/schemas.yaml | 4 ++-- docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/api/components/parameters.yaml b/docs/api/components/parameters.yaml index a3f889532b..b49828d5e1 100644 --- a/docs/api/components/parameters.yaml +++ b/docs/api/components/parameters.yaml @@ -493,6 +493,7 @@ stale: enum: - ok - update_after + - "false" key: name: key in: query diff --git a/docs/api/components/schemas.yaml b/docs/api/components/schemas.yaml index d4ca2eaaa6..692fddebd0 100644 --- a/docs/api/components/schemas.yaml +++ b/docs/api/components/schemas.yaml @@ -586,7 +586,7 @@ Changes-feed: type: object properties: seq: - description: The change sequence number. + description: The change sequence number. This is usually a plain integer, but can be a compound (string) sequence value in some cases, such as during a channel backfill. oneOf: - type: integer - type: string @@ -2777,7 +2777,7 @@ Logging-config: readOnly: true stats: type: object - description: Trace logging configuration. + description: Stats logging configuration. properties: enabled: description: Toggle for this log output diff --git a/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml b/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml index 1dd6d3079d..a19af56145 100644 --- a/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml +++ b/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml @@ -27,9 +27,9 @@ get: parameters: - name: since in: query - description: Starts the results from the change immediately after the given sequence ID. Sequence IDs should be considered opaque; they come from the last_seq property of a prior response. + description: Starts the results from the change immediately after the given sequence number. schema: - type: string + type: integer responses: '200': description: Successfully got all documents in the channel From 28b3cca6a6fc44b2c877679d2cd274985d8c3506 Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Sun, 23 Aug 2026 14:14:05 -0400 Subject: [PATCH 4/4] Add missing format types --- docs/api/components/schemas.yaml | 2 ++ docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/api/components/schemas.yaml b/docs/api/components/schemas.yaml index 692fddebd0..b5f00da3df 100644 --- a/docs/api/components/schemas.yaml +++ b/docs/api/components/schemas.yaml @@ -419,6 +419,7 @@ User-session-information: additionalProperties: x-additionalPropertiesName: channelName type: integer + format: int64 minimum: 1 description: The sequence number the user was granted access. title: sequence number @@ -589,6 +590,7 @@ Changes-feed: description: The change sequence number. This is usually a plain integer, but can be a compound (string) sequence value in some cases, such as during a channel backfill. oneOf: - type: integer + format: int64 - type: string id: description: The document ID the change happened on. diff --git a/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml b/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml index a19af56145..b2d028a0e5 100644 --- a/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml +++ b/docs/api/paths/admin/keyspace-_dumpchannel-channel.yaml @@ -30,6 +30,8 @@ get: description: Starts the results from the change immediately after the given sequence number. schema: type: integer + format: int64 + minimum: 0 responses: '200': description: Successfully got all documents in the channel