Repository navigation
fix: Only expect custom-event anonymous redaction for server SDKs - #389
Merged
Merged
Conversation
The custom-event anonymous-redaction test was enabled for client SDKs by the capability-guard fix, but client SDKs use the current (identified) context for custom events and do not redact anonymous contexts there (only feature events). Gate the redaction assertion to server-side SDKs, and add a client-side test that identifies an anonymous context and verifies the custom event carries the full, unredacted context (single- and multi-kind). Relates to SDK-2716.
keelerm84
marked this pull request as ready for review
July 21, 2026 12:56
joker23
approved these changes
Jul 21, 2026
tanderson-ld
approved these changes
Jul 21, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Aug 12, 2026
🤖 I have created a release *beep* *boop* --- ## [3.2.0-alpha.6](v3.1.1-alpha.6...v3.2.0-alpha.6) (2026-08-12) ### Features * Add contract test for streaming connection close on client shutdown ([#403](#403)) ([0f91b2a](0f91b2a)) * Add contract tests for client-side secure mode hash (h query param) ([#376](#376)) ([3e3012c](3e3012c)) * Add hook-environment-id capability and test ([#412](#412)) ([922989a](922989a)) * Add migration op event context redaction tests ([#385](#385)) ([34d68e9](34d68e9)) * add tests for handling redacting attributes prefixed with `/` correctly ([#381](#381)) ([ff6929d](ff6929d)) * Verify the in operator keeps booleans and numbers distinct ([fac2879](fac2879)) ### Bug Fixes * Correct privateAttributes JSON tag in context comparison params ([#392](#392)) ([d9d2c01](d9d2c01)) * Fix capability guarding custom event redaction ([#387](#387)) ([4d3419b](4d3419b)) * Only expect custom-event anonymous redaction for server SDKs ([#389](#389)) ([032ae14](032ae14)) * prevent client side wrapper test datasystem from colliding with primary connection mode ([#394](#394)) ([fb40bc6](fb40bc6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release-only PR** — bumps the package from `3.1.1-alpha.6` to **`3.2.0-alpha.6`** in `.release-please-manifest.json`, `main.go` (`versionString`), and adds the matching **CHANGELOG** section. > > No harness or test code changes appear in this diff; the changelog summarizes work already merged on the branch (new contract tests for streaming shutdown, client-side secure mode `h` param, hook-environment-id, migration/context redaction, `/`-prefixed attribute redaction, and `in` operator type distinction, plus fixes for `privateAttributes` JSON tagging, custom-event redaction capability guards, server-only anonymous redaction expectations, and client-side wrapper datasystem collision). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 104ac51. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v3 port of #388.
The custom-event anonymous-redaction test began running for client SDKs after the capability-guard fix (#387), but it was written for server semantics (attaching the anonymous context to the custom event via the per-event context param). Client SDKs use the current (identified) context for custom events and do NOT redact anonymous contexts there -- only in feature events, matching the other LaunchDarkly client/mobile SDKs.
Gates the redaction assertion to server-side SDKs (
!c.isClientSide), and adds client-side tests ('single-/multi-kind anonymous context is not redacted') that establish the context via identify and verify the custom event carries the full, unredacted context. Only difference from v2 is theNewSDKDataSource->NewSDKDataSystemnaming.Relates to SDK-2716.
Note
Low Risk
Test-only changes in the SDK harness; no production SDK or runtime behavior is modified.
Overview
Aligns the SDK test harness with server vs client semantics for anonymous context on custom events.
Server SDKs still must inline context and redact anonymous attributes on custom events; those assertions now run only when
!c.isClientSide.Client SDKs are expected to use the current identified context for custom events and not redact anonymous attributes there (redaction remains for feature events). New tests identify first (discarding the identify payload), send a custom event, and assert the payload carries the full, unredacted context for single- and multi-kind anonymous contexts.
Reviewed by Cursor Bugbot for commit 78d79e6. Bugbot is set up for automated code reviews on this repo. Configure here.