@posthog/convex 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export declare const version = "2.1.2";
1
+ export declare const version = "2.1.3";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export const version = '2.1.2';
1
+ export const version = '2.1.3';
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://github.com/PostHog/posthog-js/issues"
12
12
  },
13
13
  "author": "PostHog Inc.",
14
- "version": "2.1.2",
14
+ "version": "2.1.3",
15
15
  "license": "MIT",
16
16
  "keywords": [
17
17
  "convex",
@@ -48,8 +48,8 @@
48
48
  "types": "./dist/client/index.d.ts",
49
49
  "module": "./dist/client/index.js",
50
50
  "dependencies": {
51
- "@posthog/core": "^1.48.11",
52
- "posthog-node": "^5.51.2"
51
+ "@posthog/core": "^1.48.12",
52
+ "posthog-node": "^5.51.3"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@edge-runtime/vm": "^5.0.0",
@@ -200,7 +200,7 @@ describe('LocalFeatureFlagEvaluator', () => {
200
200
  expect(await evaluator.getFeatureFlag('not-pro', 'user', {}, { plan: 'free' })).toBe(true)
201
201
  })
202
202
 
203
- test('is_not_set condition resolves locally without forcing inconclusive', async () => {
203
+ test('is_not_set condition is inconclusive when the property is omitted', async () => {
204
204
  const evaluator = new LocalFeatureFlagEvaluator(
205
205
  definitions([
206
206
  makeFlag('only-anon', {
@@ -215,9 +215,7 @@ describe('LocalFeatureFlagEvaluator', () => {
215
215
  }),
216
216
  ])
217
217
  )
218
- // Key absent → property is_not_set is true → flag matches.
219
- expect(await evaluator.getFeatureFlag('only-anon', 'user', {}, {})).toBe(true)
220
- // Key present → property IS set → flag does not match.
218
+ expect(await evaluator.getFeatureFlag('only-anon', 'user', {}, {})).toBeUndefined()
221
219
  expect(await evaluator.getFeatureFlag('only-anon', 'user', {}, { email: 'a@b.com' })).toBe(false)
222
220
  })
223
221
 
@@ -37,34 +37,22 @@ describe('matchProperty — numeric comparisons', () => {
37
37
  })
38
38
  })
39
39
 
40
- describe('matchProperty — is_not_set', () => {
41
- test('returns true when the property is absent', () => {
42
- expect(matchProperty({ key: 'missing', value: 'whatever', operator: 'is_not_set' }, {})).toBe(true)
43
- })
44
-
45
- test('returns false when the property is present', () => {
46
- expect(matchProperty({ key: 'plan', value: 'whatever', operator: 'is_not_set' }, { plan: 'pro' })).toBe(false)
47
- })
48
-
49
- test('treats null-valued property as still set (returns false)', () => {
50
- // `null` counts as present in propertyValues; only genuinely missing keys read as "not set".
51
- expect(matchProperty({ key: 'plan', value: 'whatever', operator: 'is_not_set' }, { plan: null })).toBe(false)
52
- })
53
- })
54
-
55
- describe('matchProperty — is_set', () => {
56
- test('returns true when the property is present with a non-null value', () => {
57
- expect(matchProperty({ key: 'plan', value: '', operator: 'is_set' }, { plan: 'pro' })).toBe(true)
58
- })
59
-
60
- test('returns true when the property is present with a null value', () => {
61
- // `is_set` is about key presence, not value. Pre-fix, the null guard short-circuited and
62
- // returned false here.
63
- expect(matchProperty({ key: 'plan', value: '', operator: 'is_set' }, { plan: null })).toBe(true)
40
+ describe('matchProperty — presence operators', () => {
41
+ test.each([
42
+ ['null', null],
43
+ ['undefined', undefined],
44
+ ['false', false],
45
+ ['zero', 0],
46
+ ['empty string', ''],
47
+ ['empty array', []],
48
+ ['empty object', {}],
49
+ ])('treats present %s as set', (_, value) => {
50
+ expect(matchProperty({ key: 'key', value: '', operator: 'is_set' }, { key: value })).toBe(true)
51
+ expect(matchProperty({ key: 'key', value: '', operator: 'is_not_set' }, { key: value })).toBe(false)
64
52
  })
65
53
 
66
- test('throws InconclusiveMatchError when the property is absent', () => {
67
- expect(() => matchProperty({ key: 'plan', value: '', operator: 'is_set' }, {})).toThrow(InconclusiveMatchError)
54
+ test.each(['is_set', 'is_not_set'])('%s is inconclusive when the property is omitted', (operator) => {
55
+ expect(() => matchProperty({ key: 'key', value: '', operator }, {})).toThrow(InconclusiveMatchError)
68
56
  })
69
57
  })
70
58
 
@@ -152,7 +140,7 @@ describe('matchProperty — SemVer compatibility policy', () => {
152
140
  })
153
141
 
154
142
  describe('matchProperty — error cases', () => {
155
- test('throws InconclusiveMatchError when key is absent for non-is_not_set operators', () => {
143
+ test('throws InconclusiveMatchError when key is absent for other operators', () => {
156
144
  expect(() => matchProperty(prop('exact', 'x'), {})).toThrow(InconclusiveMatchError)
157
145
  })
158
146
  })
@@ -1 +1 @@
1
- export const version = '2.1.2'
1
+ export const version = '2.1.3'