Skip to content

Commit 580e109

Browse files
williazzlimhjgrace
authored andcommitted
chore: rename config aws:releaseId to releaseId (#593)
1 parent 42f986a commit 580e109

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For example, the config object may look similar to the following:
1919
| Field Name | Type | Default | Description |
2020
| --- | --- | --- | --- |
2121
| allowCookies | Boolean | `false` | Enable the web client to set and read two cookies: a session cookie named `cwr_s` and a user cookie named `cwr_u`.<br/><br/>`cwr_s` stores session data including an anonymous session ID (uuid v4) created by the web client. This allows CloudWatch RUM to compute sessionized metrics like errors per session.<br/><br/>`cwr_u` stores an anonymous user ID (uuid v4) created by the web client. This allows CloudWatch RUM to count return visitors.<br/><br/>`true`: the web client will use cookies<br/>`false`: the web client will not use cookies. |
22-
| aws:releaseId | string | `undefined` | The application release id used to find a matching source map, if any. Must match regex `^[a-zA-Z0-9_\-:/\.]{1,200}$`, including size limit 200 |
22+
| releaseId | String | `undefined` | The releaseId will be used to retrieve source map(s), if any, when RUM service unminifies JavaScript error stack traces. It should be unique to each application release and match regex ^[a-zA-Z0-9_\-:/\.]{1,200}$, including size limit of 200. |
2323
| cookieAttributes | [CookieAttributes](#cookieattributes) | `{ domain: window.location.hostname, path: '/', sameSite: 'Strict', secure: true, unique: false } ` | Cookie attributes are applied to all cookies stored by the web client, including `cwr_s` and `cwr_u`. |
2424
| sessionAttributes | [MetadataAttributes](#metadataattributes) | `{}` | Session attributes will be added the metadata of all events in the session. |
2525
| disableAutoPageView | Boolean | `false` | When this field is `false`, the web client will automatically record page views.<br/><br/>By default, the web client records page views when (1) the page first loads and (2) the browser's [history API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) is called. The page ID is `window.location.pathname`.<br/><br/>In some cases, the web client's instrumentation will not record the desired page ID. In this case, the web client's page view automation must be disabled using the `disableAutoPageView` configuration, and the application must be instrumented to record page views using the `recordPageView` command. |

src/event-cache/__tests__/EventCache.integ.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ describe('EventCache tests', () => {
127127
allowCookies: false,
128128
sessionLengthSeconds: 0
129129
},
130-
'aws:releaseId': '5.2.1'
130+
releaseId: '5.2.1'
131131
};
132132

133133
const eventCache: EventCache = Utils.createEventCache(config);

src/orchestration/Orchestration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export type PartialCookieAttributes = Partial<CookieAttributes>;
109109

110110
export interface Config {
111111
allowCookies: boolean;
112-
'aws:releaseId'?: string;
112+
releaseId?: string;
113113
batchLimit: number;
114114
client: string;
115115
clientBuilder?: ClientBuilder;

src/sessions/SessionManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export class SessionManager {
276276
// This client is used exclusively in web applications.
277277
platformType: WEB_PLATFORM_TYPE,
278278
domain: window.location.hostname,
279-
'aws:releaseId': this.config['aws:releaseId']
279+
'aws:releaseId': this.config.releaseId
280280
};
281281
}
282282

src/sessions/__tests__/SessionManager.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -848,14 +848,14 @@ describe('SessionManager tests', () => {
848848
});
849849

850850
test('when initiated with aws:releaseId then it is in the attributes', async () => {
851-
const awsReleaseId = '2.1.7';
851+
const releaseId = '2.1.7';
852852
const sessionManager = defaultSessionManager({
853853
...DEFAULT_CONFIG,
854-
'aws:releaseId': awsReleaseId
854+
releaseId
855855
});
856856

857857
const actualSessionAttributes = sessionManager.getAttributes();
858-
expect(actualSessionAttributes['aws:releaseId']).toBe(awsReleaseId);
858+
expect(actualSessionAttributes['aws:releaseId']).toBe(releaseId);
859859
});
860860

861861
test('when initiated without aws:releaseId then it is NOT in the attributes', async () => {

0 commit comments

Comments
 (0)