fiftyone.pipeline.engines.fiftyone 4.4.109 → 4.5.2

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.
@@ -36,9 +36,8 @@
36
36
  * These are all optional, so each can be omitted if the default
37
37
  * for that option is sufficient:
38
38
  *
39
- * For details of what each setting does, see the constructor
40
- * parameters in the reference documentation for the
41
- * [share usage element](https://51degrees.com/pipeline-node/class_share_usage.html)
39
+ * For details of what each setting does, see the
40
+ * [Share Usage reference](/documentation/4.5/_pipeline_api__features__usage_sharing.html)
42
41
  *
43
42
  * This example is available in full on [GitHub](https://github.com/51Degrees/pipeline-node/tree/master/fiftyone.pipeline.engines.fiftyone/examples/usageSharing/usageSharing.js).
44
43
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiftyone.pipeline.engines.fiftyone",
3
- "version": "4.4.109",
3
+ "version": "4.5.2",
4
4
  "description": "Shared base functions for implementing 51Degrees engines for the 51Degrees Pipeline API",
5
5
  "keywords": [
6
6
  "51degrees",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/jest": "^27.5.2",
26
- "@types/node": "^20.14.10",
26
+ "@types/node": "^20.19.25",
27
27
  "jest": "^27.5.1",
28
- "typescript": "^5.5.3"
28
+ "typescript": "^5.9.3"
29
29
  },
30
30
  "license": "EUPL-1.2",
31
31
  "bugs": {
@@ -390,10 +390,22 @@ test('share usage - send more than once', done => {
390
390
  setTimeout(() => {
391
391
  expect(usageEngine.shareData.length).toBe(0);
392
392
  expect(received.length).toBe(2);
393
- expect(received[0]).toContain('ua 1');
394
- expect(received[0]).not.toContain('ua 2');
395
- expect(received[1]).toContain('ua 2');
396
- expect(received[1]).not.toContain('ua 1');
393
+ // HTTP requests are asynchronous, so we can't guarantee the order
394
+ // in which they arrive at the server. Check that each UA appears
395
+ // in exactly one message without assuming order.
396
+ const msg1Contains1 = received[0].includes('ua 1');
397
+ const msg1Contains2 = received[0].includes('ua 2');
398
+ const msg2Contains1 = received[1].includes('ua 1');
399
+ const msg2Contains2 = received[1].includes('ua 2');
400
+ // Each message should contain exactly one UA
401
+ expect(msg1Contains1 !== msg1Contains2).toBe(true);
402
+ expect(msg2Contains1 !== msg2Contains2).toBe(true);
403
+ // Both UAs should be present across the two messages
404
+ expect(msg1Contains1 || msg2Contains1).toBe(true);
405
+ expect(msg1Contains2 || msg2Contains2).toBe(true);
406
+ // Each UA should appear in exactly one message
407
+ expect(msg1Contains1 !== msg2Contains1).toBe(true);
408
+ expect(msg1Contains2 !== msg2Contains2).toBe(true);
397
409
  done();
398
410
  }, 6000);
399
411
  });