Skip to content

Commit 01be595

Browse files
chore: deprecate ip config (#2053)
Co-authored-by: Rafael Audibert <[email protected]>
1 parent 977246f commit 01be595

File tree

10 files changed

+68
-62
lines changed

10 files changed

+68
-62
lines changed

packages/browser/playwright/session-recording/session-recording-network-recorder.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ test.beforeEach(async ({ context }) => {
134134
// webkit isn't capturing this failed request in the pre-wrapped fetch performance observer records
135135
// [/https:\/\/localhost:\d+\/array\/test%20token\/config.js/, 'script'],
136136
[
137-
/https:\/\/localhost:\d+\/flags\/\?v=2&config=true&ip=1&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
137+
/https:\/\/localhost:\d+\/flags\/\?v=2&config=true&ip=0&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
138138
'fetch',
139139
],
140140
// webkit isn't capturing this failed request in the pre-wrapped fetch performance observer records
141-
// [/https:\/\/localhost:\d+\/array\/test%20token\/config\?ip=1&_=\d+&ver=1\.\d\d\d\.\d+/, 'fetch'],
141+
// [/https:\/\/localhost:\d+\/array\/test%20token\/config\?ip=0&_=\d+&ver=1\.\d\d\d\.\d+/, 'fetch'],
142142
[/https:\/\/localhost:\d+\/static\/recorder.js\?v=1\.\d\d\d\.\d+/, 'script'],
143143
[/https:\/\/example.com/, expectedInitiatorType],
144144
// webkit is duplicating this, it is picked up in the initial performance observer records
@@ -155,11 +155,11 @@ test.beforeEach(async ({ context }) => {
155155
[/https:\/\/localhost:\d+\/static\/array.js/, 'script'],
156156
[/https:\/\/localhost:\d+\/array\/test%20token\/config.js/, 'script'],
157157
[
158-
/https:\/\/localhost:\d+\/flags\/\?v=2&config=true&ip=1&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
158+
/https:\/\/localhost:\d+\/flags\/\?v=2&config=true&ip=0&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
159159
'fetch',
160160
],
161161
[
162-
/https:\/\/localhost:\d+\/array\/test%20token\/config\?ip=1&_=\d+&ver=1\.\d\d\d\.\d+/,
162+
/https:\/\/localhost:\d+\/array\/test%20token\/config\?ip=0&_=\d+&ver=1\.\d\d\d\.\d+/,
163163
'fetch',
164164
],
165165
[/https:\/\/localhost:\d+\/static\/recorder.js\?v=1\.\d\d\d\.\d+/, 'script'],

packages/browser/playwright/utils/setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export async function start(
118118
const opts: Partial<PostHogConfig> = {
119119
api_host: 'https://localhost:1234',
120120
debug: true,
121+
ip: false, // Prevent IP deprecation warning in Playwright tests
121122
before_send: (event) => {
122123
const win = window as WindowWithPostHog
123124
win.capturedEvents = win.capturedEvents || []

packages/browser/src/__tests__/__snapshots__/config-snapshot.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ exports[`config snapshot for PostHogConfig 1`] = `
155155
\\"false\\",
156156
\\"true\\"
157157
],
158-
\\"ip\\": [
159-
\\"false\\",
160-
\\"true\\"
161-
],
162158
\\"opt_out_capturing_by_default\\": [
163159
\\"false\\",
164160
\\"true\\"
@@ -549,6 +545,10 @@ exports[`config snapshot for PostHogConfig 1`] = `
549545
\\"undefined\\",
550546
\\"false\\",
551547
\\"true\\"
548+
],
549+
\\"ip\\": [
550+
\\"false\\",
551+
\\"true\\"
552552
]
553553
}"
554554
`;

packages/browser/src/__tests__/extensions/exception-autocapture/exception-observer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ describe('Exception Observer', () => {
147147

148148
expect(sendRequestSpy).toHaveBeenCalled()
149149
const request = sendRequestSpy.mock.calls[0][0]
150-
expect(request.url).toBe('http://localhost/e/?ip=1')
150+
expect(request.url).toBe('http://localhost/e/?ip=0')
151151
expect(request.data).toMatchObject({
152152
event: '$exception',
153153
properties: {

packages/browser/src/__tests__/extensions/replay/config.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,45 +79,45 @@ describe('config', () => {
7979
],
8080
[
8181
{
82-
name: 'https://app.posthog.com/s/?ip=1&ver=123',
82+
name: 'https://app.posthog.com/s/?ip=0&ver=123',
8383
},
8484
undefined,
8585
undefined,
8686
],
8787
[
8888
{
89-
name: 'https://app.posthog.com/e/?ip=1&ver=123',
89+
name: 'https://app.posthog.com/e/?ip=0&ver=123',
9090
},
9191
undefined,
9292
undefined,
9393
],
9494
[
9595
{
96-
name: 'https://app.posthog.com/i/v0/e/?ip=1&ver=123',
96+
name: 'https://app.posthog.com/i/v0/e/?ip=0&ver=123',
9797
},
9898
undefined,
9999
undefined,
100100
],
101101
[
102102
{
103103
// even an imaginary future world of rust session replay capture
104-
name: 'https://app.posthog.com/i/v0/s/?ip=1&ver=123',
104+
name: 'https://app.posthog.com/i/v0/s/?ip=0&ver=123',
105105
},
106106
undefined,
107107
undefined,
108108
],
109109
[
110110
{
111111
// using a relative path as a reverse proxy api host
112-
name: 'https://app.posthog.com/ingest/s/?ip=1&ver=123',
112+
name: 'https://app.posthog.com/ingest/s/?ip=0&ver=123',
113113
},
114114
undefined,
115115
'/ingest',
116116
],
117117
[
118118
{
119119
// using a reverse proxy with a path
120-
name: 'https://app.posthog.com/ingest/s/?ip=1&ver=123',
120+
name: 'https://app.posthog.com/ingest/s/?ip=0&ver=123',
121121
},
122122
undefined,
123123
'https://app.posthog.com/ingest',

packages/browser/src/__tests__/optimised-very-large-performance-data.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@
115115
["http://localhost:8234/static/chunk-VJGIAYQC.js", 264.7, 64.9, "other", 264.7, 329.6],
116116
["http://localhost:8234/static/toolbar.js?_ts=1641815977354", 526.5, 171.1, "script", 526.5, 697.6],
117117
["http://127.0.0.1:8000/static/recorder.js?v=1.17.0", 526.9, 49.6, "script", 526.9, 576.5],
118-
["http://127.0.0.1:8000/e/?ip=1&_=1641815977365", 539.5, 80.1, "xmlhttprequest", 539.5, 619.6],
119-
["http://127.0.0.1:8000/decide/?v=2&ip=1&_=1641815977367", 541.4, 108.6, "xmlhttprequest", 541.4, 650],
120-
["http://127.0.0.1:8000/engage/?ip=1&_=1641815977381", 555.4, 69.3, "xmlhttprequest", 555.4, 624.7],
118+
["http://127.0.0.1:8000/e/?ip=0&_=1641815977365", 539.5, 80.1, "xmlhttprequest", 539.5, 619.6],
119+
["http://127.0.0.1:8000/decide/?v=2&ip=0&_=1641815977367", 541.4, 108.6, "xmlhttprequest", 541.4, 650],
120+
["http://127.0.0.1:8000/engage/?ip=0&_=1641815977381", 555.4, 69.3, "xmlhttprequest", 555.4, 624.7],
121121
["http://localhost:8234/static/chunk-SITTFVSN.js", 564, 15, "other", 564, 579],
122122
["http://localhost:8234/static/chunk-L2MXDD5E.js", 564.4, 21.3, "other", 564.4, 585.7],
123123
["http://localhost:8234/static/PerformanceWaterfall-NDELUB25.js", 564.6, 21.5, "other", 564.6, 586.1],
@@ -162,8 +162,8 @@
162162
712,
163163
1195.1
164164
],
165-
["https://app.posthog.com/e/?ip=1&_=1641815977640&v=0.0.3", 813.7, 180.7, "fetch", 813.7, 994.4],
166-
["https://app.posthog.com/e/?ip=1&_=1641815977642&v=0.0.3", 814.8, 179.8, "fetch", 814.8, 994.6],
165+
["https://app.posthog.com/e/?ip=0&_=1641815977640&v=0.0.3", 813.7, 180.7, "fetch", 813.7, 994.4],
166+
["https://app.posthog.com/e/?ip=0&_=1641815977642&v=0.0.3", 814.8, 179.8, "fetch", 814.8, 994.6],
167167
[
168168
"http://127.0.0.1:8000/api/projects/@current/feature_flags/my_flags?groups=%7B%22project%22%3A%22017dde0e-17bf-0000-b67f-e0a7b99463b2%22%2C%22organization%22%3A%22017dde0e-1268-0000-c020-25c8dbb92363%22%2C%22instance%22%3A%22http%3A%2F%2Flocalhost%3A8000%22%7D&temporary_token=udvetBiDQnR0nIdLfoKKLrmI7gmp8JE9hbox_GmMR_E",
169169
815.5,
@@ -176,95 +176,95 @@
176176
["http://127.0.0.1:8000/static/icons/favicon-dev.ico?v=2021-04-29", 945.9, 69.7, "other", 945.9, 1015.6],
177177
["http://127.0.0.1:8000/static/site.webmanifest?v=2021-04-29", 946.2, 23.6, "other", 946.2, 969.8],
178178
[
179-
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=1&_=1641816000187",
179+
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=0&_=1641816000187",
180180
23361.3,
181181
41.4,
182182
"xmlhttprequest",
183183
23361.3,
184184
23402.7
185185
],
186186
[
187-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816000238",
187+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816000238",
188188
23413.8,
189189
269.4,
190190
"xmlhttprequest",
191191
23413.8,
192192
23683.2
193193
],
194194
[
195-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816003252",
195+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816003252",
196196
26427.2,
197197
14.9,
198198
"xmlhttprequest",
199199
26427.2,
200200
26442.1
201201
],
202202
[
203-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816006256",
203+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816006256",
204204
29430.2,
205205
23.1,
206206
"xmlhttprequest",
207207
29430.2,
208208
29453.3
209209
],
210210
[
211-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816009260",
211+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816009260",
212212
32434.2,
213213
41.4,
214214
"xmlhttprequest",
215215
32434.2,
216216
32475.6
217217
],
218218
[
219-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816012263",
219+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816012263",
220220
35438.5,
221221
21.7,
222222
"xmlhttprequest",
223223
35438.5,
224224
35460.2
225225
],
226226
[
227-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816015572",
227+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816015572",
228228
38746.2,
229229
52.8,
230230
"xmlhttprequest",
231231
38746.2,
232232
38799
233233
],
234234
[
235-
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=1&_=1641816015575",
235+
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=0&_=1641816015575",
236236
38749.1,
237237
33.5,
238238
"xmlhttprequest",
239239
38749.1,
240240
38782.6
241241
],
242242
[
243-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816018579",
243+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816018579",
244244
41753.2,
245245
30.8,
246246
"xmlhttprequest",
247247
41753.2,
248248
41784
249249
],
250250
[
251-
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=1&_=1641816018581",
251+
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=0&_=1641816018581",
252252
41755.1,
253253
22.3,
254254
"xmlhttprequest",
255255
41755.1,
256256
41777.4
257257
],
258258
[
259-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816021584",
259+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816021584",
260260
44759.2,
261261
26.4,
262262
"xmlhttprequest",
263263
44759.2,
264264
44785.6
265265
],
266266
[
267-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816024589",
267+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816024589",
268268
47764.1,
269269
15.4,
270270
"xmlhttprequest",
@@ -318,15 +318,15 @@
318318
],
319319
["http://localhost:8234/static/assets/posthog-icon-FDVNZJ5Z.svg", 50352.2, 5.2, "css", 50352.2, 50357.4],
320320
[
321-
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=1&_=1641816027596",
321+
"http://127.0.0.1:8000/s/?compression=gzip-js&ip=0&_=1641816027596",
322322
50770.1,
323323
54.4,
324324
"xmlhttprequest",
325325
50770.1,
326326
50824.5
327327
],
328328
[
329-
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=1&_=1641816027601",
329+
"http://127.0.0.1:8000/e/?compression=gzip-js&ip=0&_=1641816027601",
330330
50776,
331331
24.5,
332332
"xmlhttprequest",

0 commit comments

Comments
 (0)