Invalid client_session
entity with stateStorageStrategy: 'none'
#1298
Labels
type:defect
Bugs or weaknesses. The issue has to contain steps to reproduce.
Describe the bug
The client_session entity requires that the
userId
value be provided as a string matching a pattern (^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$|^[0-9a-f]{16}$
) and thesessionId
be provided as a UUID.In the JS tracker, this value is usually populated with what would be the Domain User ID value and Session ID values, respectively.
To accommodate this, when creating the
client_session
entity, the tracker does a few compatibility checks for anonymousTracking to ensure it produces valid data.Mostly the checks are:
withSessionTracking
, do not include the entity at all as bothuserId
andsessionId
values are unavailablewithSessionTracking
, use the nil UUID in place of domain user ID to pass validationHowever, if
stateStorageStrategy
isnone
(via initial configuration or toggling viaenableAnonymousTracking
) butanonymousTracking
is not enabled (possible in the latter case by providingoptions: false
), these checks will pass, but the tracker will populateuserId
andsessionId
with an empty string as the respective identifiers are not available. The resulting event will fail schema validation.To Reproduce
Expected behavior
Valid event produced by omitting client_session entity or falling back to nil UUID for user/session IDs.
Screenshots
Event fails validation on client_session entity:
Additional context
See Zendesk #40198
The text was updated successfully, but these errors were encountered: