Skip to content

Commit 502c4c0

Browse files
authored
Revert "feat: Enjoy the benefits of /decide?v=4 (#1838)" (#1842)
This reverts commit 4c25512.
1 parent d4b982d commit 502c4c0

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ 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+\/decide\/\?v=4&ip=1&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
137+
/https:\/\/localhost:\d+\/decide\/\?v=3&ip=1&_=\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
@@ -158,7 +158,7 @@ test.beforeEach(async ({ context }) => {
158158
[/https:\/\/localhost:\d+\/static\/array.js/, 'script'],
159159
[/https:\/\/localhost:\d+\/array\/test%20token\/config.js/, 'script'],
160160
[
161-
/https:\/\/localhost:\d+\/decide\/\?v=4&ip=1&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
161+
/https:\/\/localhost:\d+\/decide\/\?v=3&ip=1&_=\d+&ver=1\.\d\d\d\.\d+&compression=base64/,
162162
'fetch',
163163
],
164164
[

src/__tests__/posthog-core.loaded.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('loaded() with flags', () => {
4141
expect(instance._send_request).toHaveBeenCalledTimes(1)
4242

4343
expect(instance._send_request.mock.calls[0][0]).toMatchObject({
44-
url: 'https://us.i.posthog.com/decide/?v=4',
44+
url: 'https://us.i.posthog.com/decide/?v=3',
4545
data: {
4646
groups: { org: 'bazinga' },
4747
},
@@ -64,7 +64,7 @@ describe('loaded() with flags', () => {
6464
expect(instance._send_request).toHaveBeenCalledTimes(1)
6565

6666
expect(instance._send_request.mock.calls[0][0]).toMatchObject({
67-
url: 'https://us.i.posthog.com/decide/?v=4',
67+
url: 'https://us.i.posthog.com/decide/?v=3',
6868
data: {
6969
groups: { org: 'bazinga' },
7070
},
@@ -77,7 +77,7 @@ describe('loaded() with flags', () => {
7777
expect(instance._send_request).toHaveBeenCalledTimes(2)
7878

7979
expect(instance._send_request.mock.calls[1][0]).toMatchObject({
80-
url: 'https://us.i.posthog.com/decide/?v=4',
80+
url: 'https://us.i.posthog.com/decide/?v=3',
8181
data: {
8282
groups: { org: 'bazinga2' },
8383
},

src/__tests__/posthog-core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ describe('posthog core', () => {
12191219
})
12201220

12211221
expect(sendRequestMock.mock.calls[0][0]).toMatchObject({
1222-
url: 'http://localhost/decide/?v=4',
1222+
url: 'http://localhost/decide/?v=3',
12231223
})
12241224
})
12251225

src/__tests__/utils/request-router.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('request-router', () => {
5858
[' https://app.posthog.com ', 'https://us.i.posthog.com/'],
5959
['https://example.com/', 'https://example.com/'],
6060
])('should sanitize the api_host values for "%s"', (apiHost, expected) => {
61-
expect(router(apiHost).endpointFor('api', '/decide?v=4')).toEqual(`${expected}decide?v=4`)
61+
expect(router(apiHost).endpointFor('api', '/decide?v=3')).toEqual(`${expected}decide?v=3`)
6262
})
6363

6464
it('should use the ui_host if provided', () => {

src/entrypoints/array.full.es5.ts

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// it doesn't include recorder which doesn't support IE11,
66
// and it doesn't include web-vitals which doesn't support IE11
77

8-
import 'core-js/features/object/from-entries'
9-
108
import './surveys'
119
import './exception-autocapture'
1210
import './tracing-headers'

src/posthog-featureflags.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ export class PostHogFeatureFlags {
393393
this._requestInFlight = true
394394
this.instance._send_request({
395395
method: 'POST',
396-
url: this.instance.requestRouter.endpointFor('api', '/decide/?v=4'),
396+
url: this.instance.requestRouter.endpointFor('api', '/decide/?v=3'),
397397
data,
398398
compression: this.instance.config.disable_compression ? undefined : Compression.Base64,
399399
timeout: this.instance.config.feature_flag_request_timeout_ms,
@@ -557,7 +557,7 @@ export class PostHogFeatureFlags {
557557
const token = this.instance.config.token
558558
this.instance._send_request({
559559
method: 'POST',
560-
url: this.instance.requestRouter.endpointFor('api', '/decide/?v=4'),
560+
url: this.instance.requestRouter.endpointFor('api', '/decide/?v=3'),
561561
data: {
562562
distinct_id: this.instance.get_distinct_id(),
563563
token,

0 commit comments

Comments
 (0)