Skip to content

Commit a59aaa2

Browse files
chore: bump posthog version to latest (#1439)
1 parent 48a74ad commit a59aaa2

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

apps/browser-extension-wallet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"openpgp": "^5.11.2",
8080
"p-debounce": "^4.0.0",
8181
"pluralize": "^8.0.0",
82-
"posthog-js": "^1.68.4",
82+
"posthog-js": "^1.161.3",
8383
"process": "^0.11.10",
8484
"qrcode": "^1.5.3",
8585
"react": "17.0.2",

apps/browser-extension-wallet/src/providers/PostHogClientProvider/client/PostHogClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ export class PostHogClient<Action extends string = string> {
5858
request_batching: false,
5959
api_host: this.postHogHost,
6060
autocapture: false,
61+
opt_out_useragent_filter: true,
62+
disable_compression: true,
6163
disable_session_recording: true,
6264
capture_pageview: false,
6365
capture_pageleave: false,
64-
disable_compression: true,
6566
// Disables PostHog user ID persistence - we manage ID ourselves with userIdService
6667
disable_persistence: true,
6768
disable_cookie: true,

packages/e2e-tests/src/steps/analyticsSteps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const validateEventProperty = async (event: string, property: string, pro
2626
When(/^I set up request interception for posthog analytics request\(s\)$/, async () => {
2727
await browser.pause(1000);
2828
await browser.setupInterceptor();
29-
await browser.excludeUrls([new RegExp('^(?!https://e.lw.iog.io/e).*')]);
29+
await browser.excludeUrls([new RegExp('^(?!https://e.lw.iog.io).*')]);
3030
});
3131

3232
When(/^I validate latest analytics multiple events:$/, async (eventActionNames: DataTable) => {

packages/e2e-tests/src/utils/postHogAnalyticsUtils.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
import { browser } from '@wdio/globals';
22

33
const getRequestDataPayload = async (request: any): Promise<any> => {
4-
const requestPayloadBase64Data = decodeURIComponent(String(request.body)).replace('data=', '');
5-
return JSON.parse(Buffer.from(requestPayloadBase64Data, 'base64').toString('ascii'));
4+
if (!request.body) {
5+
console.warn('Request body is undefined');
6+
return {};
7+
}
8+
9+
const requestBody = typeof request.body === 'string' ? request.body : JSON.stringify(request.body);
10+
11+
try {
12+
return JSON.parse(requestBody);
13+
} catch {
14+
const requestPayloadBase64Data = decodeURIComponent(requestBody).replace('data=', '');
15+
return JSON.parse(Buffer.from(requestPayloadBase64Data, 'base64').toString('ascii'));
16+
}
617
};
718

819
export const getAllEventsNames = async (): Promise<string[]> => {

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11356,7 +11356,7 @@ __metadata:
1135611356
openpgp: ^5.11.2
1135711357
p-debounce: ^4.0.0
1135811358
pluralize: ^8.0.0
11359-
posthog-js: ^1.68.4
11359+
posthog-js: ^1.161.3
1136011360
process: ^0.11.10
1136111361
qrcode: ^1.5.3
1136211362
react: 17.0.2
@@ -44940,7 +44940,7 @@ __metadata:
4494044940
languageName: node
4494144941
linkType: hard
4494244942

44943-
"posthog-js@npm:^1.68.4":
44943+
"posthog-js@npm:^1.161.3":
4494444944
version: 1.161.6
4494544945
resolution: "posthog-js@npm:1.161.6"
4494644946
dependencies:

0 commit comments

Comments
 (0)