Skip to content

docs(ui-capture): add the four capture SDK 3.1.0 error codes to the errors page - #961

Merged
slayerjain merged 2 commits into
mainfrom
docs/ui-capture-sdk-error-codes
Nov 12, 2026
Merged

slayerjain merged 2 commits into
mainfrom
docs/ui-capture-sdk-error-codes

Conversation

@slayerjain

@slayerjain slayerjain commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

@keploy/capture-sdk 3.1.0 adds four codes that link to sections of https://keploy.io/docs/ui-capture/errors that do not exist yet. Every onError CaptureError carries remedy.docs, and each SDK_WARNINGS entry carries the same kind of link: https://keploy.io/docs/ui-capture/errors#<code in lower case, '_' -> '-'>. The live page has no #kui-e-capture-declined, #kui-e-privacy-conflict, #kui-e-navigation-unwrapped or #kui-e-request-term-failed, so those links open the top of the page.

SDK version described: the sections describe @keploy/capture-sdk 3.1.0, as on keploy/ui-capture main at 8299000d4c (the 3.1.0 release-prep commit; 3.1.0 is not on npm yet, whose latest is still 3.0.1). Every sentence was checked against the SDK source at 1a95cf1c92, and an independent review rechecked them at 8299000d4c, where the four codes' behaviour is unchanged: packages/sdk/src/ errors.ts, index.ts, recorder.ts, transport.ts, network.ts, request-term.ts, types.ts, privacy.ts and redact.ts. It was also checked against the SDK's tests, the contract's error corpus (packages/contract/generated/error-corpus.json), spec/sdk-errors.v3.json and spec/canonical-key.v2.json. Claims about 3.0.1 were checked against the 3.0.1 package on npm.

What changes

versioned_docs/version-4.0.0/ui-capture/errors.md (served at /docs/ui-capture/errors):

  • Four new sections, in the page's existing format: ## \CODE` {#id}`, then What happened / Cause / Fix / Evidence.
    • KUI_E_CAPTURE_DECLINED (error)
      • Raised when Do Not Track or Global Privacy Control is on and honorPrivacySignals is on, which is the default.
      • init() then records, patches and sends nothing. onError hears every declined init(), and the console.info line is written once per page.
      • The check runs before sampleRate, sessionIdGenerator, the privacy-route check and the rrweb import. So those errors never show up in Brave or DuckDuckGo, which send GPC by default.
      • Advice: keep this code out of error trackers, and set honorPrivacySignals: false only with your own lawful basis.
    • KUI_E_PRIVACY_CONFLICT (error)
      • Raised for privacyMode: "strict" together with privacy.maskNetworkBodies: false. That includes a privacy object built from the exported defaultPrivacyConfig(), whose maskNetworkBodies is false.
      • The capture never starts. The check runs before the privacy signal and before sampling.
      • The section also says what balanced records that strict replaces.
    • KUI_E_NAVIGATION_UNWRAPPED (warning, console only): the page locked a History or Navigation API method the SDK wraps, so the SDK wraps none of them. The section lists what the recording loses.
    • KUI_E_REQUEST_TERM_FAILED (warning, console only)
      • Computing a request's GraphQL term threw: the request is recorded with no term.
      • Or the term chunk did not load: the request is recorded body:*, and so is every such request for the rest of the page.
      • The section says how each case replays, and how to fix it, including the import-map entry needed without a bundler.
  • Corrections elsewhere on the page, where the new codes made it wrong:
    • Rows for the four codes in the summary table.
    • "seven error codes" becomes "nine".
    • The warnings paragraph no longer says every warning drops an event.
    • The intro notes that the decline is logged with console.info.
    • The onError example returns early on the decline.
    • The 3.0.1 note lists what 3.0.1 lacks.
    • The "call init() again from onError" sentence now names the five codes that come back with the same options, because a handler that retries on them calls itself again.

scripts/verify-ui-capture-sdk-links.js: the four codes are added to ERROR_CODES. CI's yarn verify-ui-capture-sdk-links now fails if any of the SDK's 14 links (SDK_ERRORS plus SDK_WARNINGS) has no <h2 id> with What happened / Cause / Fix.

Checks

  • prettier@2.8.8 --check (the version CI pins) passes on both files.
  • All 14 remedy.docs fragments in spec/sdk-errors.v3.json equal a {#id} on the page byte for byte, and the verifier's list equals that set.
  • I ran the verifier against a stand-in build made from the page's {#id} headings. It passes on this branch, and fails on main for exactly the four new anchors. On the live site, Docusaurus renders each existing {#id} as that <h2 id>. I did not run a full docusaurus build locally; CI's build and verify-ui-capture-sdk-links cover that.

Review follow-up (e755345): four claims narrowed to what the SDK does: the request-term replay paragraph, which exposed private matching rules; what is still scrubbed after an unwrapped navigation; secure contexts (localhost and loopback); and the intro's repeated SDK_WARNINGS.

…rrors page

@keploy/capture-sdk 3.1.0 links every onError CaptureError (remedy.docs) and
every SDK_WARNINGS entry to https://keploy.io/docs/ui-capture/errors#<code>,
and four of those anchors did not exist: kui-e-capture-declined,
kui-e-privacy-conflict, kui-e-navigation-unwrapped and
kui-e-request-term-failed.

Adds a section for each, in the page's existing format, describing
keploy/ui-capture main at 1a95cf1c92:

- KUI_E_CAPTURE_DECLINED: Do Not Track or Global Privacy Control with
  honorPrivacySignals on (the default). Nothing is recorded, patched or
  sent; onError hears every declined init(), console.info once per page.
- KUI_E_PRIVACY_CONFLICT: privacyMode "strict" with
  privacy.maskNetworkBodies false (defaultPrivacyConfig() included).
- KUI_E_NAVIGATION_UNWRAPPED: a locked History or Navigation API method,
  so none is wrapped; what the recording loses.
- KUI_E_REQUEST_TERM_FAILED: the GraphQL term threw (no term) or its chunk
  did not load (body:* for the life of the page); how each replays.

Also fixes what the new codes made false on the page: "seven" error codes,
"every warning drops an event", and init() from onError always starting a
fresh capture. Adds the four codes to verify-ui-capture-sdk-links.js, so CI
fails if any of the SDK's 14 links has no section.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
slayerjain added a commit that referenced this pull request Nov 12, 2026
…he SDK does

Review of #961: the request-term replay paragraph exposed private matching rules and is cut to what an integrator can rely on; the unwrapped-navigation scrub sentence now says what is still scrubbed by name and shape; a page without SubtleCrypto is plain HTTP from a host other than localhost or a loopback address; the intro names SDK_WARNINGS once.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
A review of the four new sections found claims that went past what the
SDK does. The request-term replay paragraph exposed private matching
rules and is cut to what an integrator can rely on. The unwrapped
navigation sentence now says what is still scrubbed by name and shape.
A page without SubtleCrypto is plain HTTP from a host other than
localhost or a loopback address. The intro names SDK_WARNINGS once.

Signed-off-by: slayerjain <shubhamkjain@outlook.com>
@slayerjain
slayerjain force-pushed the docs/ui-capture-sdk-error-codes branch from ab69fab to e755345 Compare November 12, 2026 09:36
@slayerjain
slayerjain merged commit cfe8b92 into main Nov 12, 2026
6 checks passed
@slayerjain
slayerjain deleted the docs/ui-capture-sdk-error-codes branch November 12, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant