@effect-app/infra 4.0.0-beta.311 → 4.0.0-beta.313

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @effect-app/infra
2
2
 
3
+ ## 4.0.0-beta.313
4
+
5
+ ### Patch Changes
6
+
7
+ - effect-app@4.0.0-beta.313
8
+
9
+ ## 4.0.0-beta.312
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [9ea024d]
14
+ - effect-app@4.0.0-beta.312
15
+
3
16
  ## 4.0.0-beta.311
4
17
 
5
18
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/infra",
3
- "version": "4.0.0-beta.311",
3
+ "version": "4.0.0-beta.313",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -15,7 +15,7 @@
15
15
  "proper-lockfile": "^4.1.2",
16
16
  "pure-rand": "8.4.0",
17
17
  "query-string": "^9.4.0",
18
- "effect-app": "4.0.0-beta.311"
18
+ "effect-app": "4.0.0-beta.313"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@azure/cosmos": "^4.9.3",
@@ -414,13 +414,43 @@ describe("repository ext save/remove batching", () => {
414
414
  const allSpan = spans.find((_) => _.name === "Repository.all")
415
415
  expect(saveSpan?.attributes.get("app.schema.encode.duration_ms")).toEqual(expect.any(Number))
416
416
  expect(saveSpan?.attributes.get("app.schema.item_count")).toBe(1)
417
+ expect(saveSpan?.attributes.get("app.schema.slow")).toBe(false)
417
418
  expect(saveSpan?.attributes.get("db.operation.duration_ms")).toEqual(expect.any(Number))
418
419
  expect(allSpan?.attributes.get("app.schema.decode.duration_ms")).toEqual(expect.any(Number))
419
420
  expect(allSpan?.attributes.get("app.schema.item_count")).toBe(1)
421
+ expect(allSpan?.attributes.get("app.schema.slow")).toBe(false)
420
422
  expect(allSpan?.attributes.get("db.operation.duration_ms")).toEqual(expect.any(Number))
421
423
  })
422
424
  .pipe(
423
425
  setupRequestContextFromCurrent(),
424
426
  Effect.provide(TestStoreLive)
425
427
  ))
428
+
429
+ it.effect("annotates entity state tag on encode when items are tagged", () =>
430
+ Effect
431
+ .gen(function*() {
432
+ const spans: Tracer.NativeSpan[] = []
433
+ const tracer = Tracer.make({
434
+ span(options) {
435
+ const span = new Tracer.NativeSpan(options)
436
+ spans.push(span)
437
+ return span
438
+ }
439
+ })
440
+
441
+ yield* Effect
442
+ .gen(function*() {
443
+ const repo = yield* makeRepo("TaggedTelemetry", union, {})
444
+ yield* repo.save({ _tag: "A", id: "1" })
445
+ })
446
+ .pipe(Effect.provideService(Tracer.Tracer, tracer))
447
+
448
+ const saveSpan = spans.find((_) => _.name === "Repository.saveAndPublish")
449
+ expect(saveSpan?.attributes.get("app.entity.state")).toBe("A")
450
+ expect(saveSpan?.attributes.get("app.schema.slow")).toBe(false)
451
+ })
452
+ .pipe(
453
+ setupRequestContextFromCurrent(),
454
+ Effect.provide(TestStoreLive)
455
+ ))
426
456
  })