Skip to content

[Bug]: sessionAttributes not added to recordError event #672

@anthony-nhs

Description

@anthony-nhs

Which web client version did you detect this bug with?

v1.24.0

What environment (build systems, module system, and framework) did you detect this bug with?

TypeScript v5.8.3, Webpack v5.99.9, ECMAScript modules (ESM) and React v18.3.1

Is your web application a single page application (SPA) or multi page application (MPA)?

SPA

Please provide your web client configuration

{
  allowCookies: true,
  batchLimit: 100,
  client: "arw-module",
  cookieAttributes: {
    unique: false,
    domain: "localhost",
    path: "/",
    sameSite: "Strict",
    secure: true,
  },
  disableAutoPageView: false,
  dispatchInterval: 5000,
  enableRumClient: true,
  enableXRay: true,
  endpoint: "https://dataplane.rum.eu-west-2.amazonaws.com",
  endpointUrl: {},
  eventCacheSize: 200,
  eventPluginsToLoad: [],
  pageIdFormat: "PATH",
  pagesToExclude: [],
  pagesToInclude: [
    {},
  ],
  signing: true,
  recordResourceUrl: true,
  retries: 2,
  routeChangeComplete: 100,
  routeChangeTimeout: 10000,
  sessionAttributes: {
    cptAppVersion: "PR-1019",
    cptAppCommit: "ce4821f8950c3aad054395d1e1326aaa3a3d1b20",
  },
  sessionEventLimit: 0,
  sessionLengthSeconds: 1800,
  sessionSampleRate: 1,
  telemetries: [
    "errors",
    "performance",
    "http",
  ],
  useBeacon: true,
  userIdRetentionDays: 30,
  candidatesCacheSize: 10,
  guestRoleArn: "arn:aws:iam::000000000000:role/RUM-Monitor-us-west-2-000000000000-00xx-Unauth",
  identityPoolId: "us-west-2:00000000-0000-0000-0000-000000000000",
  releaseId: "ce4821f8950c3aad054395d1e1326aaa3a3d1b20",
}

Please describe the bug/issue

According to the config I am setting custom session attributes cptAppVersion and cptAppCommit
These are added to the metadata of all events, apart from when I call recordError. The error event does get sent to AWS Rum, but it does not include the extra session attributes I have added.

I have also tried explicitly adding the session attributes before calling recordError, but they are still not added to the event

      cptAwsRum.addSessionAttributes({
        cptAppVersion: "PR-1019",
        cptAppCommit: "ce4821f8950c3aad054395d1e1326aaa3a3d1b20"
      })
      cptAwsRum.recordError(error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions