Reproduce RUMS-5828: 128 attribute cap drops legitimate payloads#1274
Draft
Reproduce RUMS-5828: 128 attribute cap drops legitimate payloads#1274
Conversation
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.
Reproduction for RUMS-5828
Issue Summary
The React Native SDK's v3 attribute encoder caps every event at 128 leaf attributes via
MAX_ATTRIBUTES = 128inpackages/core/src/sdk/AttributesEncoding/helpers.ts, silently dropping any leaves beyond the cap. Realistic payloads with arrays of small objects (e.g. 22 items × 6 props = 132 leaves) trigger the cap during normalDdLogs.info(...)usage. In the nested-array case the overflow happens before the array wrapper itself is written, so the entire top-level attribute is dropped — the customer's payload reaches the native layer as{}.Reproduction Tests
packages/core/src/sdk/AttributesEncoding/__tests__/attributesEncoding.test.ts)What the Tests Prove
Three new tests in the
RUMS-5828: 128 attribute cap drops legitimate payloadsdescribe block fail today, documenting the bug as the customer experiences it:_dd.*attributes consume slots in the user-attribute budget instead of being SDK overhead.Four companion tests under
RUMS-5828: current behavior pin (regression contract)describe the exact present-day semantics; they pass today and serve as a regression contract against accidental future changes:{}plus 1 limit-reached warn + 5 dropped-attribute warns (4 inner-prop drops on the 22nd item:'c','d','e','f', plus 1 wrapper drop for'basicTestArray').'k128'._dd.*attributes consume one slot of the 128-attribute budget.Root Cause Analysis
The v3 attribute-encoding rewrite (introduced in #1008, commit a3c778c) added a hard cap of 128 in
addEncodedAttribute. The cap was chosen as a defensive halving of the documented 256-attribute platform limit becausevalidateAttributesis called twice per event-path. With recursive flattening (arrays of objects expanded as nested objects whose primitive properties each calladdEncodedAttributeand incrementnumOfAttributes), legitimate analytics payloads can exceed 128 leaves and trigger silent drops. In the nested-array case, the inner-leaf increments overflow the cap before the outer array wrapper is written, so even the top-level attribute itself is dropped.Call Chain
DdLogs.info(message, context)→DdLogsWrapper.log(...)→encodeAttributes(event.context)→encodeAttributesInPlace(value, out, path, encoders, context)(recurses into arrays/objects) → for each item in the array,normalize(item)→ recursiveencodeAttributesInPlace(item, nested, [], encoders, context)→addEncodedAttribute(nested, [k], v, context)per leaf → ifcontext.numOfAttributes >= 128: emit warns and drop. After all items processed, the outer-arrayaddEncodedAttribute(out, ['basicTestArray'], normalizedArray, context)is also dropped becausenumOfAttributesis now at the cap.Regression Evidence
On source:react-native, v3.3.0 (released ~mid-April 2026, ~3.9M sessions over 30d) introduced the JS-side attribute encoder cap of 128 leaves per event in commit a3c778c (PR #1008,
Limit encoded attributes to 128). The platform's documented per-event limit is 256 attributes (with backend feature-flagrum_parse_big_eventsextending to 2048). The RN cap is intentionally conservative versus the backend ceiling. No new failure mode inlogs.rum.telemetry.errorsfor v3.3.0 vs v3.2.0 or v2.14.3 — the attribute-drop is reported only as a JSconsole.warnand is not measurable in the public-side telemetry metric family.Failure Output
Generated by rum:tee-triage-insights