@utk09/ui-observability 1.0.0 → 1.1.0

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.
Files changed (221) hide show
  1. package/CHANGELOG.md +69 -219
  2. package/README.md +24 -26
  3. package/dist/{batch-CXmPmTse.js → batch-D3NHhF9L.js} +3 -3
  4. package/dist/{batch-CXmPmTse.js.map → batch-D3NHhF9L.js.map} +1 -1
  5. package/dist/{batch-mmPigCpi.cjs → batch-DnYRJqhU.cjs} +2 -2
  6. package/dist/{batch-mmPigCpi.cjs.map → batch-DnYRJqhU.cjs.map} +1 -1
  7. package/dist/bus/bus.d.cts +26 -2
  8. package/dist/bus/bus.d.ts +26 -2
  9. package/dist/bus-B__467mL.cjs +2 -0
  10. package/dist/bus-B__467mL.cjs.map +1 -0
  11. package/dist/{bus-C39wspFV.js → bus-dw7T92sO.js} +37 -24
  12. package/dist/bus-dw7T92sO.js.map +1 -0
  13. package/dist/capture/interactions.d.cts +35 -3
  14. package/dist/capture/interactions.d.ts +35 -3
  15. package/dist/capture/observed-windows.d.cts +51 -0
  16. package/dist/capture/observed-windows.d.ts +51 -0
  17. package/dist/{compression-CvED_Jel.cjs → compression-C0hUHKR-.cjs} +2 -2
  18. package/dist/{compression-CvED_Jel.cjs.map → compression-C0hUHKR-.cjs.map} +1 -1
  19. package/dist/{compression-tVtXwVjX.js → compression-SHPAvS4U.js} +2 -2
  20. package/dist/{compression-tVtXwVjX.js.map → compression-SHPAvS4U.js.map} +1 -1
  21. package/dist/{config-SgQcCP1_.js → config-CSNcS7OZ.js} +194 -196
  22. package/dist/config-CSNcS7OZ.js.map +1 -0
  23. package/dist/config-CybPP5VM.cjs +2 -0
  24. package/dist/config-CybPP5VM.cjs.map +1 -0
  25. package/dist/{console-BGgGnjSi.js → console-BsM-fSCQ.js} +4 -4
  26. package/dist/{console-BGgGnjSi.js.map → console-BsM-fSCQ.js.map} +1 -1
  27. package/dist/{console-CSZ5_Vx5.cjs → console-Dkxs6IVQ.cjs} +2 -2
  28. package/dist/{console-CSZ5_Vx5.cjs.map → console-Dkxs6IVQ.cjs.map} +1 -1
  29. package/dist/{constants-CUyd9cTZ.js → constants-BwJDXzj6.js} +23 -23
  30. package/dist/constants-BwJDXzj6.js.map +1 -0
  31. package/dist/constants-CtF52hIV.cjs +2 -0
  32. package/dist/constants-CtF52hIV.cjs.map +1 -0
  33. package/dist/constants.d.cts +12 -0
  34. package/dist/constants.d.ts +12 -0
  35. package/dist/core/diagnostics.d.cts +1 -1
  36. package/dist/core/diagnostics.d.ts +1 -1
  37. package/dist/core/rotation.d.cts +26 -2
  38. package/dist/core/rotation.d.ts +26 -2
  39. package/dist/core/runtime.d.cts +9 -0
  40. package/dist/core/runtime.d.ts +9 -0
  41. package/dist/{debug-bundle-BXIlwDKM.cjs → debug-bundle-B2v6Cym-.cjs} +2 -2
  42. package/dist/{debug-bundle-BXIlwDKM.cjs.map → debug-bundle-B2v6Cym-.cjs.map} +1 -1
  43. package/dist/{debug-bundle-CRpYV_ui.js → debug-bundle-Cs_YWzTa.js} +4 -4
  44. package/dist/{debug-bundle-CRpYV_ui.js.map → debug-bundle-Cs_YWzTa.js.map} +1 -1
  45. package/dist/doctor.cjs +1 -1
  46. package/dist/doctor.js +31 -31
  47. package/dist/doctor.js.map +1 -1
  48. package/dist/{errors-CNPbesMs.cjs → errors-DP2RUm4V.cjs} +2 -2
  49. package/dist/{errors-CNPbesMs.cjs.map → errors-DP2RUm4V.cjs.map} +1 -1
  50. package/dist/{errors-BE_EZV7Q.js → errors-Q3Ng1ciC.js} +3 -3
  51. package/dist/{errors-BE_EZV7Q.js.map → errors-Q3Ng1ciC.js.map} +1 -1
  52. package/dist/{factory-CTi0Is3F.js → factory-DV17sm2p.js} +22 -22
  53. package/dist/{factory-CTi0Is3F.js.map → factory-DV17sm2p.js.map} +1 -1
  54. package/dist/{factory-hRrH32v5.cjs → factory-K8O6gpux.cjs} +2 -2
  55. package/dist/{factory-hRrH32v5.cjs.map → factory-K8O6gpux.cjs.map} +1 -1
  56. package/dist/{identity-DdhKgrpk.js → identity-BgtHyY4u.js} +38 -27
  57. package/dist/identity-BgtHyY4u.js.map +1 -0
  58. package/dist/identity-CvuyqZk7.cjs +2 -0
  59. package/dist/identity-CvuyqZk7.cjs.map +1 -0
  60. package/dist/index.cjs +1 -1
  61. package/dist/index.cjs.map +1 -1
  62. package/dist/index.d.cts +1 -0
  63. package/dist/index.d.ts +1 -0
  64. package/dist/index.js +600 -569
  65. package/dist/index.js.map +1 -1
  66. package/dist/{indexeddb-storage-CL9uqBCy.cjs → indexeddb-storage-D4KVcqdD.cjs} +2 -2
  67. package/dist/{indexeddb-storage-CL9uqBCy.cjs.map → indexeddb-storage-D4KVcqdD.cjs.map} +1 -1
  68. package/dist/{indexeddb-storage-GHdl0t8A.js → indexeddb-storage-e-13ZLWm.js} +17 -17
  69. package/dist/{indexeddb-storage-GHdl0t8A.js.map → indexeddb-storage-e-13ZLWm.js.map} +1 -1
  70. package/dist/interactions-Byxf1C82.js +207 -0
  71. package/dist/interactions-Byxf1C82.js.map +1 -0
  72. package/dist/interactions-OK85T-Dk.cjs +2 -0
  73. package/dist/interactions-OK85T-Dk.cjs.map +1 -0
  74. package/dist/{journey-D2_sia57.js → journey-C93FTYcs.js} +14 -14
  75. package/dist/{journey-D2_sia57.js.map → journey-C93FTYcs.js.map} +1 -1
  76. package/dist/{journey-B4Adltjm.cjs → journey-nMbob3OB.cjs} +2 -2
  77. package/dist/{journey-B4Adltjm.cjs.map → journey-nMbob3OB.cjs.map} +1 -1
  78. package/dist/{library-console-CPW6bvZH.cjs → library-console-DJUQzcgM.cjs} +2 -2
  79. package/dist/{library-console-CPW6bvZH.cjs.map → library-console-DJUQzcgM.cjs.map} +1 -1
  80. package/dist/{library-console-Btrzt814.js → library-console-DklSmucS.js} +2 -2
  81. package/dist/{library-console-Btrzt814.js.map → library-console-DklSmucS.js.map} +1 -1
  82. package/dist/{library-request-BJ9PLRaD.js → library-request-UGEwOHpf.js} +2 -2
  83. package/dist/{library-request-BJ9PLRaD.js.map → library-request-UGEwOHpf.js.map} +1 -1
  84. package/dist/{library-request-D7OvTxZV.cjs → library-request-kY9iTpIF.cjs} +2 -2
  85. package/dist/{library-request-D7OvTxZV.cjs.map → library-request-kY9iTpIF.cjs.map} +1 -1
  86. package/dist/{lifecycle-22CUCrc9.js → lifecycle-B2PlIuQu.js} +2 -2
  87. package/dist/{lifecycle-22CUCrc9.js.map → lifecycle-B2PlIuQu.js.map} +1 -1
  88. package/dist/{lifecycle-IaAm1mOC.cjs → lifecycle-DaMdH_X7.cjs} +2 -2
  89. package/dist/{lifecycle-IaAm1mOC.cjs.map → lifecycle-DaMdH_X7.cjs.map} +1 -1
  90. package/dist/{log-record-CkivuiEl.cjs → log-record-Bmx6etMh.cjs} +2 -2
  91. package/dist/{log-record-CkivuiEl.cjs.map → log-record-Bmx6etMh.cjs.map} +1 -1
  92. package/dist/{log-record-BNiLfqtL.js → log-record-DSt2P-Sr.js} +2 -2
  93. package/dist/{log-record-BNiLfqtL.js.map → log-record-DSt2P-Sr.js.map} +1 -1
  94. package/dist/{long-frames-DNFaRnC3.js → long-frames-Bamjs1WV.js} +3 -3
  95. package/dist/{long-frames-DNFaRnC3.js.map → long-frames-Bamjs1WV.js.map} +1 -1
  96. package/dist/{long-frames-BUUbXd-B.cjs → long-frames-lhtONgGt.cjs} +2 -2
  97. package/dist/{long-frames-BUUbXd-B.cjs.map → long-frames-lhtONgGt.cjs.map} +1 -1
  98. package/dist/models/bus.d.cts +6 -1
  99. package/dist/models/bus.d.ts +6 -1
  100. package/dist/models/config.d.cts +23 -8
  101. package/dist/models/config.d.ts +23 -8
  102. package/dist/models/serializer.d.cts +3 -1
  103. package/dist/models/serializer.d.ts +3 -1
  104. package/dist/{network-CGMLQ-mA.cjs → network-BCn8Gn47.cjs} +2 -2
  105. package/dist/{network-CGMLQ-mA.cjs.map → network-BCn8Gn47.cjs.map} +1 -1
  106. package/dist/{network-on2zZT6H.js → network-Cg1L2w2r.js} +12 -12
  107. package/dist/{network-on2zZT6H.js.map → network-Cg1L2w2r.js.map} +1 -1
  108. package/dist/observed-windows-B3gJkdql.cjs +2 -0
  109. package/dist/observed-windows-B3gJkdql.cjs.map +1 -0
  110. package/dist/observed-windows-BrwaJNlj.js +64 -0
  111. package/dist/observed-windows-BrwaJNlj.js.map +1 -0
  112. package/dist/{otlp-BENHf3g9.cjs → otlp-CrAWkQdO.cjs} +2 -2
  113. package/dist/{otlp-BENHf3g9.cjs.map → otlp-CrAWkQdO.cjs.map} +1 -1
  114. package/dist/{otlp-DimfrRor.js → otlp-D6dRZyB8.js} +6 -6
  115. package/dist/{otlp-DimfrRor.js.map → otlp-D6dRZyB8.js.map} +1 -1
  116. package/dist/{platform-BaaFIPCU.js → platform-8DLhjddo.js} +7 -7
  117. package/dist/{platform-BaaFIPCU.js.map → platform-8DLhjddo.js.map} +1 -1
  118. package/dist/{platform-CfA3-7sJ.cjs → platform-BqRc-7RO.cjs} +2 -2
  119. package/dist/{platform-CfA3-7sJ.cjs.map → platform-BqRc-7RO.cjs.map} +1 -1
  120. package/dist/{profiler-BAZoh7A4.js → profiler-BaXSqCfz.js} +59 -59
  121. package/dist/{profiler-BAZoh7A4.js.map → profiler-BaXSqCfz.js.map} +1 -1
  122. package/dist/{profiler-D4tJpDRc.cjs → profiler-BvWW2kNM.cjs} +2 -2
  123. package/dist/{profiler-D4tJpDRc.cjs.map → profiler-BvWW2kNM.cjs.map} +1 -1
  124. package/dist/{profiler-frames-cJMx9wNM.js → profiler-frames-C4ySHN0X.js} +16 -16
  125. package/dist/{profiler-frames-cJMx9wNM.js.map → profiler-frames-C4ySHN0X.js.map} +1 -1
  126. package/dist/{profiler-frames-C4xr7KfH.cjs → profiler-frames-DeaBiB-5.cjs} +2 -2
  127. package/dist/{profiler-frames-C4xr7KfH.cjs.map → profiler-frames-DeaBiB-5.cjs.map} +1 -1
  128. package/dist/{remote-rules-_tY0zj5o.cjs → remote-rules-D7L6D_D2.cjs} +2 -2
  129. package/dist/{remote-rules-_tY0zj5o.cjs.map → remote-rules-D7L6D_D2.cjs.map} +1 -1
  130. package/dist/{remote-rules-Dz9MRAsB.js → remote-rules-Dq9xe7Qn.js} +22 -22
  131. package/dist/{remote-rules-Dz9MRAsB.js.map → remote-rules-Dq9xe7Qn.js.map} +1 -1
  132. package/dist/{replay-Ds-ANH34.js → replay-B0M8kWz_.js} +24 -24
  133. package/dist/{replay-Ds-ANH34.js.map → replay-B0M8kWz_.js.map} +1 -1
  134. package/dist/{replay-B3gFXIZd.cjs → replay-QOFBpAXh.cjs} +2 -2
  135. package/dist/{replay-B3gFXIZd.cjs.map → replay-QOFBpAXh.cjs.map} +1 -1
  136. package/dist/{reports-C-thq-bk.js → reports--8APRLa-.js} +3 -3
  137. package/dist/{reports-C-thq-bk.js.map → reports--8APRLa-.js.map} +1 -1
  138. package/dist/{reports-BDSe4dFH.cjs → reports-ojuMKGO7.cjs} +2 -2
  139. package/dist/{reports-BDSe4dFH.cjs.map → reports-ojuMKGO7.cjs.map} +1 -1
  140. package/dist/{resource-timing-eUl2dNgC.js → resource-timing-BzR05rE-.js} +4 -4
  141. package/dist/{resource-timing-eUl2dNgC.js.map → resource-timing-BzR05rE-.js.map} +1 -1
  142. package/dist/{resource-timing-C576gFIQ.cjs → resource-timing-pAG3ZhB5.cjs} +2 -2
  143. package/dist/{resource-timing-C576gFIQ.cjs.map → resource-timing-pAG3ZhB5.cjs.map} +1 -1
  144. package/dist/{response-body-eoSQpLiH.js → response-body-BWvwKQ2p.js} +106 -106
  145. package/dist/{response-body-eoSQpLiH.js.map → response-body-BWvwKQ2p.js.map} +1 -1
  146. package/dist/{response-body-YdNl-HkR.cjs → response-body-CKEJ5itk.cjs} +3 -3
  147. package/dist/{response-body-YdNl-HkR.cjs.map → response-body-CKEJ5itk.cjs.map} +1 -1
  148. package/dist/{rotation-Cwct4ckk.js → rotation-BylN1B9e.js} +10 -11
  149. package/dist/rotation-BylN1B9e.js.map +1 -0
  150. package/dist/rotation-E2eKClIs.cjs +2 -0
  151. package/dist/rotation-E2eKClIs.cjs.map +1 -0
  152. package/dist/{sampling-mXt4dstx.cjs → sampling-B46LW0cy.cjs} +2 -2
  153. package/dist/{sampling-mXt4dstx.cjs.map → sampling-B46LW0cy.cjs.map} +1 -1
  154. package/dist/{sampling-BlrI8jor.js → sampling-zXA6r-Nw.js} +16 -16
  155. package/dist/{sampling-BlrI8jor.js.map → sampling-zXA6r-Nw.js.map} +1 -1
  156. package/dist/{sanitize-Ba0KqU06.js → sanitize-DjnR6RXR.js} +2 -2
  157. package/dist/{sanitize-Ba0KqU06.js.map → sanitize-DjnR6RXR.js.map} +1 -1
  158. package/dist/{sanitize-DQyiI_KY.cjs → sanitize-Qj6LuZqp.cjs} +2 -2
  159. package/dist/{sanitize-DQyiI_KY.cjs.map → sanitize-Qj6LuZqp.cjs.map} +1 -1
  160. package/dist/{sender-Dv8rAmpV.js → sender-Bdp-TAS4.js} +71 -71
  161. package/dist/{sender-Dv8rAmpV.js.map → sender-Bdp-TAS4.js.map} +1 -1
  162. package/dist/{sender-BdRuNVhF.cjs → sender-DR7ZycZY.cjs} +2 -2
  163. package/dist/{sender-BdRuNVhF.cjs.map → sender-DR7ZycZY.cjs.map} +1 -1
  164. package/dist/{stored-context-CXt7eHZL.cjs → stored-context-BOu54M8Y.cjs} +2 -2
  165. package/dist/{stored-context-CXt7eHZL.cjs.map → stored-context-BOu54M8Y.cjs.map} +1 -1
  166. package/dist/{stored-context-B2EzVuYm.js → stored-context-CSttrAsw.js} +6 -6
  167. package/dist/{stored-context-B2EzVuYm.js.map → stored-context-CSttrAsw.js.map} +1 -1
  168. package/dist/{storm-C-zYSdDX.cjs → storm-BHgI12iS.cjs} +2 -2
  169. package/dist/{storm-C-zYSdDX.cjs.map → storm-BHgI12iS.cjs.map} +1 -1
  170. package/dist/{storm-DjKetLKZ.js → storm-DKlpv0FL.js} +2 -2
  171. package/dist/{storm-DjKetLKZ.js.map → storm-DKlpv0FL.js.map} +1 -1
  172. package/dist/{unclean-exit-py99ApzT.cjs → unclean-exit-BYPYYkQ5.cjs} +2 -2
  173. package/dist/{unclean-exit-py99ApzT.cjs.map → unclean-exit-BYPYYkQ5.cjs.map} +1 -1
  174. package/dist/{unclean-exit-DQD1cT7c.js → unclean-exit-BcOB8A2e.js} +2 -2
  175. package/dist/{unclean-exit-DQD1cT7c.js.map → unclean-exit-BcOB8A2e.js.map} +1 -1
  176. package/dist/{user-timing-BePqb1uN.js → user-timing-4KIJ74Vi.js} +2 -2
  177. package/dist/{user-timing-BePqb1uN.js.map → user-timing-4KIJ74Vi.js.map} +1 -1
  178. package/dist/{user-timing-D6XTmpuM.cjs → user-timing-BsU2wQKE.cjs} +2 -2
  179. package/dist/{user-timing-D6XTmpuM.cjs.map → user-timing-BsU2wQKE.cjs.map} +1 -1
  180. package/dist/utils/identity.d.cts +5 -0
  181. package/dist/utils/identity.d.ts +5 -0
  182. package/dist/{web-socket-CoIUBM3C.cjs → web-socket-Cs1ZbmmN.cjs} +2 -2
  183. package/dist/{web-socket-CoIUBM3C.cjs.map → web-socket-Cs1ZbmmN.cjs.map} +1 -1
  184. package/dist/{web-socket-DSHgDiZ6.js → web-socket-Zg0hj1LB.js} +4 -4
  185. package/dist/{web-socket-DSHgDiZ6.js.map → web-socket-Zg0hj1LB.js.map} +1 -1
  186. package/dist/{worker-protocol-x074Rpet.js → worker-protocol-CYpAbrVl.js} +4 -4
  187. package/dist/{worker-protocol-x074Rpet.js.map → worker-protocol-CYpAbrVl.js.map} +1 -1
  188. package/dist/{worker-protocol-QbvqNazn.cjs → worker-protocol-DFYXIFus.cjs} +2 -2
  189. package/dist/{worker-protocol-QbvqNazn.cjs.map → worker-protocol-DFYXIFus.cjs.map} +1 -1
  190. package/dist/{worker-server-CFe4nvos.cjs → worker-server--yGTadTA.cjs} +2 -2
  191. package/dist/{worker-server-CFe4nvos.cjs.map → worker-server--yGTadTA.cjs.map} +1 -1
  192. package/dist/{worker-server-iUVSjH8L.js → worker-server-BokySIII.js} +25 -25
  193. package/dist/{worker-server-iUVSjH8L.js.map → worker-server-BokySIII.js.map} +1 -1
  194. package/dist/worker-transport-BdEvh_-a.cjs +2 -0
  195. package/dist/worker-transport-BdEvh_-a.cjs.map +1 -0
  196. package/dist/{worker-transport-Dy1KMA7t.js → worker-transport-JK-Fby9J.js} +23 -19
  197. package/dist/worker-transport-JK-Fby9J.js.map +1 -0
  198. package/llms.txt +13 -10
  199. package/package.json +13 -5
  200. package/dist/bus-C39wspFV.js.map +0 -1
  201. package/dist/bus-_EaOVPGq.cjs +0 -2
  202. package/dist/bus-_EaOVPGq.cjs.map +0 -1
  203. package/dist/config-DUs7uHHt.cjs +0 -2
  204. package/dist/config-DUs7uHHt.cjs.map +0 -1
  205. package/dist/config-SgQcCP1_.js.map +0 -1
  206. package/dist/constants-CUyd9cTZ.js.map +0 -1
  207. package/dist/constants-CqdJhTxH.cjs +0 -2
  208. package/dist/constants-CqdJhTxH.cjs.map +0 -1
  209. package/dist/identity-DdhKgrpk.js.map +0 -1
  210. package/dist/identity-DlWRIuwy.cjs +0 -2
  211. package/dist/identity-DlWRIuwy.cjs.map +0 -1
  212. package/dist/interactions-CUkzK8sR.cjs +0 -2
  213. package/dist/interactions-CUkzK8sR.cjs.map +0 -1
  214. package/dist/interactions-DiFvCosX.js +0 -111
  215. package/dist/interactions-DiFvCosX.js.map +0 -1
  216. package/dist/rotation-Cwct4ckk.js.map +0 -1
  217. package/dist/rotation-D4qUAHAu.cjs +0 -2
  218. package/dist/rotation-D4qUAHAu.cjs.map +0 -1
  219. package/dist/worker-transport-CRAX-09c.cjs +0 -2
  220. package/dist/worker-transport-CRAX-09c.cjs.map +0 -1
  221. package/dist/worker-transport-Dy1KMA7t.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,215 +2,65 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
- ## [1.0.0] - 2026-11-20
6
-
7
- The first stable release. It has breaking changes from 0.12.0. Read `docs/migration-v1.md` before you upgrade. Each feature of 1.0.0 is stable. `docs/release-and-support.md` gives the stability rules and the deprecation policy.
8
-
9
- ### Added - v1.0.0
10
-
11
- - `gauge(name, options)` returns a gauge. `set(value, attributes?)` keeps the last value for each attribute set. Each interval sends that value as one point. With `metricsEndpoint`, the point is an OTLP gauge.
12
- - `measure(name, fn, attributes?)` times one function call. A promise result ends the measure when it settles. A throw or a rejection gives the outcome `"error"`. The histogram is `ui.measure.duration` with the attributes `measure.name` and `measure.outcome`.
13
- `shutdown(options?)` takes options. The default `pending: "flush"` sends the open interval of the meters and the profiler, and each record in memory. It waits for those requests, then runs the exit flush and stops each request that is still open. The stored batches stay in storage.
14
- - `shutdown({ pending: "discard" })` sends nothing and runs no exit flush. `onDrop` reports each record in memory with `discarded`.
15
- - `shutdown({ clearStorage: "context" | "namespace" })` discards. It removes the stored batches, the emergency queue entries, the stored session id, the tab id and the journey. It also works after an earlier `shutdown()`. `clearStorage: null` removes nothing.
16
- - `flush({ timeoutMs })` and the flush result. The result has `status`, `accepted`, `stored`, `dropped`, `forwarded` and `pending`. Each count is a number of records. `status` is `"complete"`, `"timeout"` or `"inactive"`. `"complete"` means that no record waits. It does not prove delivery.
17
- - `getHealth().delivery` has `lastFailureAt`, `consecutiveFailures`, `throttledUntil` and `dropped`. A rotation resets the first three. It keeps `dropped` and `lastSendAt`.
18
- - The `LossReason` `"partially_rejected"`. An OTLP `2xx` answer with `partialSuccess` gives the rejected count to `onDrop`. The library does not send the batch again.
19
- - The `LossReason` `"disabled"`. It reports a record that a child context forwards during a pause. It also reports the held records when the first `configure()` call sets `enabled: false`. It also reports the records in memory at a `pagehide` or a `shutdown()` during a pause. Each record is reported one time.
20
- - The `LossReason` `"discarded"`.
21
- - `buffering.maxHeldRecords` limits each hold buffer. The default is 500, and the range is 200 to 10000.
22
- - The diagnostic codes `transport.partial_success`, `capture.trace_header_kept`, `bus.protocol_mismatch` and `security.rotation_failed`.
23
- - The `getHealth()` issues `security.rotation_failed` and `records.refused`.
24
- - The bus messages `ui-observability.message.flush-request` and `ui-observability.message.flush-result`.
25
- - New exported types: `DeliveryHealth`, `FlushOptions`, `FlushResult`, `FlushStatus`, `Gauge`, `Logger`, `RoutingOptions`, `ShutdownOptions` and `StorageScope`. The package exports the options type of each config section.
26
- - `llms.txt` in the package. It describes the library for a large language model, with the public functions, the main config keys, the recipes and the common mistakes.
27
- - `docs/migration-v1.md`. It gives the steps from 0.12.x to 1.0.0.
28
- - `docs/api.md`, `docs/configuration.md`, `docs/guides.md`, `docs/ingest-server.md` and `docs/development.md`. They hold the reference text from the README.
29
- - `docs/release-and-support.md`, the release contract. It has a release step that turns on GitHub private vulnerability reporting.
30
- - `docs/production-recipes.md`. It gives login, logout, tenant rotation, token refresh, consent withdrawal and the initialization order. It also tells how to change the context after a failed load of the rotation code.
31
- - `docs/architecture.md`. It gives the record path, the buffers and the state changes of the runtime.
32
- - `SECURITY.md`. It gives the private route for a vulnerability report.
33
- - `pnpm run check:consumers`. It packs the package and type-checks three consumers. `verify` runs it.
34
- - `pnpm run test:e2e`. It runs the browser tests in Chromium, Firefox and WebKit. The tests include the session replay with the real `@rrweb/record` recorder, a `srcdoc` frame on the message link and a failed load of the rotation code.
35
- - `pnpm run test:collector`. It sends records to a pinned OpenTelemetry Collector and checks what the collector wrote.
36
- - `pnpm run bench:release`. It runs the release benchmark against `bench/budgets.json`.
37
- - The mock ingest server has `GET /__received`, `GET /__echo` and `POST /__reset` for tests. `UIOBS_MOCK_PORT` sets its port. `UIOBS_MOCK_RECORD=1` keeps the requests.
38
- - `uiobs doctor` names the `415` of a stock OpenTelemetry Collector in the result of the `beacon` rule.
39
-
40
- ### Changed - v1.0.0
41
-
42
- #### Start and pause
43
-
44
- - **Breaking:** The library starts at the first `configure()` call that works. Before that call, it installs no capture. It starts no bus and no sender. It sends nothing.
45
- - A log call before `configure()` waits in the hold buffer. With the default `consoleOutput` settings, it prints nothing.
46
- - At the start, a held record gets the `processors`, the `redact` hook, the identity, the levels, the sampling, the `limits` and the `page.url` rule of the startup call.
47
- - At the start, the library removes the breadcrumbs of log calls from before the start. The breadcrumbs of `addBreadcrumb()` stay.
48
- - Before the first `configure()` call that works, the ids stay in memory. The library writes nothing to `localStorage` or `sessionStorage`.
49
- - The first `configure()` call that works sets each setting that is fixed at startup, also after an early log call. This includes `identity`, `correlation`, `storage`, `bus.mode`, `bus.openFinRole` and `otelLoader`.
50
- - **Breaking:** `enabled: false` pauses the library at any time. The library first sends the open interval of the counters, gauges, histograms and probes. It then removes its captures, the replay recorder and its network patches. The sender sends nothing. The records from before the pause go out after `enabled: true`.
51
- - A pause stores no new record. A failed request in flight, a sender load that ends, a `retain` rotation and a logout deletion still change storage.
52
- - A first `configure()` call with `enabled: false` fixes the startup settings. It starts no bus and no sender, and it writes nothing to storage. The runtime starts at the first `enabled: true`.
53
- - A paused forwarder drops the records of its child contexts.
54
- - `shutdown()` during a pause sends nothing. A rotation with `pending: "flush"` during a pause acts as `discard`.
55
- - **Breaking:** `rotateSecurityContext()` rejects before the first `configure()` call that works.
56
- - **Breaking:** `getHealth().status` has two new values, `"unconfigured"` and `"disabled"`. A failed first `configure()` call reports `"unconfigured"`.
57
-
58
- #### Config rules
59
-
60
- - **Breaking:** In each `configure()` call, an omitted key or a key with the value `undefined` keeps its current value. This applies at each depth.
61
- - **Breaking, security:** `headers: undefined` now keeps the headers and the token in them. With isolation on, which is the default, use `rotateSecurityContext()` at logout. With isolation off, use `headers: null`.
62
- - **Breaking:** `null` removes a hook. This applies to `redact`, `onDrop`, `onDiagnostic`, `contextProvider`, `otelLoader`, `transport`, `transportOnExit`, `transportWorker`, `capture.urlTransform` and the `loader` of `capture.webVitals`.
63
- - **Breaking, security:** A `redact` value that is not a function keeps the current hook. Without a current hook, the library drops each record until `redact` is a function or `null`.
64
- - **Breaking, security:** A `processors` list with an entry that is not a function keeps the current list. Without a current list, the library drops each record until `processors` is a list of functions or `[]`.
65
- - **Breaking, security:** If the first `configure()` call cannot read its options, the library writes a console warning. It installs no capture and drops each record until a call sets `redact` to a function or `null`.
66
- - **Breaking:** On a limit key, `null` sets no limit and `0` sets a limit of zero. Before, `0` set no limit.
67
- - **Breaking:** These keys do not accept `0`: `buffering.maxPendingRecords`, `buffering.maxPendingBytes`, `correlation.sessionIdleMs`, `correlation.traceMaxAgeMs`, `debugBuffer.maxAgeMs`, `bus.maxMessageBytes`, `bus.maxRecordsPerMessage` and `bus.maxMessagesPerSecond`. `captureLimits.windowMs` must be 1 or more.
68
- - **Breaking:** `null` turns off `metricsEndpoint`, `tracesEndpoint` and `replay.endpoint`. Their default is `null`. An empty or blank string also turns them off, and it reports `config.invalid`.
69
- - **Breaking, security:** A relative endpoint URL resolves against `document.baseURI`. The library reports the origin that gets the records. It refuses an endpoint URL with a user name or a password, and it refuses a blank `endpoint`.
70
- - **Breaking:** A new `sampling.rates` map replaces the current map. A rate outside 0 to 1 removes its entry.
71
- - **Breaking:** `sampling.alwaysSampleTypes` has the type `LogType[]`. An unknown type reports `config.invalid`.
72
- - **Breaking:** A `consoleOutput` object without `level` keeps the current level.
73
- - **Breaking:** `metrics.maxHistogramBoundaries` applies only to the boundaries that the app gives to `histogram()`.
74
- - **Breaking:** You cannot change `bus.mode` and `bus.openFinRole` after startup. A later change reports `config.invalid` and keeps the value.
75
- - An invalid `sampling.defaultRate`, `sampling.remoteMaxRate` or `serializer` keeps the current value.
76
- - A message for a hook, a URL key or a choice key does not print the text of the value.
77
- - A config section that is not an object reports `config.invalid`.
78
- - These pairs report `config.invalid`, and the values stay: `transport` with `transportWorker`, `transportOnExit` without `transport`, `capture.remoteToggles` without `sampling.remote`, and `capture.propagateTraceHeaderTo` without `capture.fetch` or `capture.xhr`.
79
- - The resolved config no longer copies an unknown key.
80
-
81
- #### Config shape
82
-
83
- - **Breaking:** The section `capturePolicy` is now `captureLimits`. `captureLimits.windowMs` sets only the capture rate limits.
84
- - **Breaking:** `sampling.errorCeiling` replaces `capturePolicy.errorCeiling`. `sampling.errorCeilingWindowMs` sets its window.
85
- - **Breaking:** `metrics.intervalMs` replaces `batching.metricFlushIntervalMs` and `profiler.flushIntervalMs`. Counters, gauges, histograms and probes use this interval.
86
- - **Breaking:** A capture with options takes `true` or an options object. `longFrames: { thresholdMs }`, `userTiming: { include }`, `webVitals: { loader }` and `console: { levels }` replace `longFrameMs`, `userTimingInclude`, `webVitalsLoader` and the console list. An unknown key inside an options object reports `config.invalid`.
87
- - **Breaking:** The `storage` section replaces the `storage` string and the `persistence` section: `storage: { backend, namespace, requestPersistent }`. You cannot change the section after startup.
88
- - **Breaking:** `consoleOutput` replaces the top-level `console` key. `ConsoleOutputOptions` replaces `ConsoleOptions`.
89
- - **Breaking:** Each section type has the name of its key plus `Options`, for example `SamplingOptions`. The `...Policy` type names are gone.
90
- - **Breaking:** `replay.maxSegmentEvents` and `replay.maxSegmentBytes` replace `replay.batchSize` and `replay.batchBytes`.
91
- - **Breaking:** `replay.uploadWindowMs` sets the window of `replay.uploadsPerWindow`. Before, `capturePolicy.windowMs` set it.
92
-
93
- #### Security context rotation
94
-
95
- - **Breaking:** `rotateSecurityContext()` takes the routing settings in `routing`. The type `DeliveryOptions` is now `RoutingOptions`. Each key that is not a routing setting reports `config.invalid`, and the rotation ignores it.
96
- - **Breaking:** Rotation `timeoutMs` accepts 0 to 600000. A value outside this range rejects the rotation.
97
- - **Breaking, security:** A rejected rotation stops the delivery of the old context. The library drops each new record with the `onDrop` reason `security_context` until a rotation succeeds. `getHealth()` shows `security.rotation_failed` and `senderReady: false`.
98
- - **Breaking, security:** After a rejected rotation, the next rotation that succeeds applies its `pending` rule to the stored records and the emergency queue of the closed context. With `flush`, it removes them, as `discard` does.
99
- - **Breaking:** `rotateSecurityContext()` calls run in call order. A call during another rotation waits, and then it runs.
100
- - **Breaking:** A rotation rejects only for a routing value that it cannot apply. A warning does not reject it.
101
- - **Breaking:** A rotation in a forwarder rejects, and the forwarder's delivery stays open.
102
- - **Breaking:** A record that the library builds during a rotation goes to `onDrop` at once with `security_context`.
103
- - A rotation with `pending: "discard"` or `"flush"` removes the stored batches of the old context also when no sender runs, for example during a pause or before consent.
104
- - A rotation with `pending: "retain"` stores the records that wait in memory under the old context.
105
- - `rotateSecurityContext()` rejects an `update.context` that is not an object. A `null` context counts as no context. A `null` or `undefined` value in `update.context` sets no key.
106
- - The rotation code loads in its own chunk on the first `rotateSecurityContext()`.
107
-
108
- #### Public API
109
-
110
- - **Breaking:** `flush()` now returns `Promise<FlushResult>`, not `Promise<void>`.
111
- - **Breaking:** `flush()` now waits at most 5000 ms by default. `timeoutMs` sets the wait, from 0 to 600000 ms.
112
- - **Breaking:** In a frame, a worker or an OpenFin view, `flush()` now waits for the answer of the sender. The sender gets 90 percent of the time that is left.
113
- - **Breaking:** `getHealth()` puts the delivery state in a `delivery` block. `pending`, `inFlight`, `stored` and `lastSendAt` are no longer top-level fields.
114
- - **Breaking:** `setContext(values)` takes an attribute map and merges it. A `null` value removes its key. An `undefined` value keeps the current value. A value that is not an object reports `config.invalid` and changes nothing.
115
- - **Breaking:** `getJourneyToken()` returns `null` when no journey is active.
116
- - **Breaking:** The package exports the logger class only as the type `Logger`. `getLogger()` and `PluginContext.logger` use `Logger`.
117
- - **Breaking:** `startTrace()` is now `newTrace()`.
118
- - `getHealth().delivery.consecutiveFailures` resets only when the server accepts a batch.
119
-
120
- #### Delivery
121
-
122
- - **Breaking:** Without `headers`, the exit batch to another origin is a keepalive `fetch` with `text/plain;charset=UTF-8`. It obeys `credentials`, so by default it sends no cookie. Only `credentials: "include"` uses `sendBeacon`. The CORS answer of the ingest server must permit the origin of the page.
123
- - **Breaking:** The exit batch to an endpoint on the origin of the page is a keepalive `fetch` with the content type of the serializer. Before, it was a `text/plain` beacon.
124
- - **Breaking:** A `fetch` request that already has a `traceparent` header keeps it. The library records no client span for it and reports `capture.trace_header_kept`. Before, the library replaced the header.
125
- - **Breaking:** On a metric point from a frame or a worker, the `redact` of the sender can change `metric.name`, `metric.unit` and `metric.attribute_keys`.
126
- - A forwarded record gets its metric and span fields back only when its `log.type` and namespace are those of the library, and each field has the shape that the library writes.
127
- - The library reads at most 16 KiB of the body of a `413` or of an OTLP `2xx` answer. `delivery.requestTimeoutMs` also limits that read.
128
- - The main thread waits 1000 ms more for an answer from a transport worker that is ready.
129
- - A full hold buffer keeps its first 100 records of each kind. It drops the oldest record after them.
130
- - `StorageAdapter.save()` returns `Promise<boolean>`. The value is true only when the batch is in storage when the save ends.
131
- - The `transport.http_error` and `transport.throttled` texts tell whether storage kept the batch.
132
- - The exit flush counts the keepalive bytes that are still in flight from the flush of the hidden page.
133
-
134
- #### Bus
135
-
136
- - **Breaking:** A same-origin child frame compares the bus protocol tag of its parent with its own tag before a direct call. With a different tag, it reports `bus.protocol_mismatch` and tries a message link.
137
- - The bus starts a flush for other contexts at most one time each second. It keeps at most 4 waiting flush requests for each source and 100 in total.
138
- - The bus does not take a flush request on the broadcast link.
139
- - A flush that a frame or a worker asks for does not send the open interval of the metrics and the profiler of its sender.
140
- - The bus sends each answer for a worker to that worker only.
141
-
142
- #### Session replay
143
-
144
- - **Breaking:** Session replay always blocks each element in `[data-observability-ignore]`.
145
- - The `capture.rate_limited` text for a full replay buffer says that the replay of an error in that time starts at the error, with no events from before it.
146
-
147
- #### Build, browsers and docs
148
-
149
- - The build targets ES2021. The library supports Chrome 85, Edge 85, Firefox 79 and Safari 14.1 and later.
150
- - The README and `docs/browser-support.md` state that OpenFin support is not validated on a real OpenFin runtime.
151
- - The gzip budget of the main graph is 55,524 B. The measured main graph is 50,478 B.
152
- - The README is short. It has the installation, the quick start, three recipes and a table of the reference documents.
153
- - The ingest contract is in `docs/ingest-server.md`. Its rules do not change.
154
- - Lint enforces braces on each conditional again. `eslint-config-prettier` had turned the `curly` rule off.
155
-
156
- ### Removed - v1.0.0
157
-
158
- - **Breaking:** `logMetric()` and the logger method `logMetric()`. Use `counter()`, `gauge()` or `histogram()`.
159
- - **Breaking:** `timeSync()`, `timeAsync()` and the logger methods of the same names. Use `measure()`. `measure()` logs no ERROR record on a failure.
160
- - **Breaking:** `getStats()` and `getQueueDepth()`. Use `getHealth().delivery`.
161
- - **Breaking:** `clearPersistedLogs()`. Use `shutdown({ pending: "discard", clearStorage: scope })`.
162
- - **Breaking:** `setContextMap()`. Use `setContext(values)`.
163
- - **Breaking:** The type `DeliveryStats` and the value export `OneLogger`.
164
- - **Breaking:** `retention.mode`. Set `retention.maxAgeMs` and `retention.maxAttempts` to `null` in place of `"until-delivered"`.
165
- - **Breaking:** `delivery.retryIdleDelayMs`, `delivery.batchesPerDrain`, `correlation.sessionTouchMs`, `bus.maxTrackedSources` and `capturePolicy.maxErrorSignatures`. A config with one of these keys reports `config.invalid`.
166
- - **Breaking:** `bus.validation`. The bus always checks each message. `getHealth().bus` no longer has `validation` and `maxTrackedSources`.
167
-
168
- ### Fixed - v1.0.0
169
-
170
- - A log call no longer throws in Chrome 92, Firefox 91 and Safari 15.3 or older. Before, with console output or with `processors`, each log call threw. A second `configure()` also threw.
171
- - Session replay sets `replay.id` when the browser has no `crypto.randomUUID`. This also applies to a page on plain `http`.
172
- - `TransportError` keeps its `cause` in browsers without the ES2022 `cause` option.
173
- - The type declarations work for a strict consumer with `moduleResolution` `"NodeNext"` (ES module or CommonJS) or `"Bundler"`, also with `skipLibCheck: false`. `exports` gives `import` and `require` each its own declarations, `index.d.ts` and `index.d.cts`.
174
- - `configure({ redact: undefined })` no longer removes `redact`. The other hooks and the transports have the same fix.
175
- - `redact`, `onDiagnostic`, `otelLoader` and the `loader` of `capture.webVitals` report `config.invalid` for a value that is not a function.
176
- - `configure()` no longer throws when a getter in its input throws.
177
- - `configure()` no longer writes into the app's object.
178
- - A key that is fixed at startup no longer reports "cannot change after startup" for the value `undefined`.
179
- - A histogram without custom boundaries no longer reports `config.invalid` when the boundary limit is low.
180
- - `sampling: { defaultRate: undefined }` no longer sets the rate to `1`.
181
- - `serviceName`, `serviceVersion`, `environment` and `securityContext.id` report `config.invalid` for a value that is not a string.
182
- - An `undefined` style no longer reports `config.invalid`. `consoleOutput.styles: null` now reports `config.invalid`.
183
- - A failed first `configure()` call after an early log call no longer lets records go out without `redact`.
184
- - A failed first `configure()` call writes no id to `localStorage` or `sessionStorage`. It reports `config.invalid` to diagnostics, and it writes the console warning.
185
- - A frame that logs before `configure()` uses the `bus.mode` of its first `configure()` call.
186
- - A journey that starts before `configure()` stays active after the call. The journey token leaves the URL.
187
- - A `newSession()` call before `configure()` keeps its session after the start.
188
- - `onDrop` reports each lost record one time, also when a `pagehide` comes before a later rotation or `shutdown()`.
189
- - A `shutdown()` before the end of startup reports the held records to `onDrop` with `load_failed`.
190
- - A rotation that waits for the delivery stack load at `shutdown()` stops and rejects. Before, it could remove the stored batches of the old context.
191
- - A rotation that a shutdown stops after it took the old records reports those records to `onDrop` with `security_context`.
192
- - A rotation that a shutdown meets in its storage step rejects, and does not apply the new context.
193
- - A delivery stack load that ends after a rejected rotation no longer sends the stored batches of the old context.
194
- - After `shutdown()`, `startJourney()` and `adoptJourney()` write nothing to `sessionStorage`.
195
- - `flush()` no longer waits without end for a request or a storage call that does not settle.
196
- - A response body that stalls no longer holds a send past the request deadline or after a stop.
197
- - `fetch(request, init)` with trace propagation builds the request one time with the whole init of the caller. With an empty init, it keeps the referrer of the request.
198
- - A refused beacon marks the keepalive budget as used, so a later exit batch goes to the emergency queue.
199
- - A diagnostic no longer says that the library stored a batch that storage did not keep.
200
- - A `srcdoc` or `about:blank` frame forwards its records through its same-origin parent. Before, the parent refused its `"null"` origin, and the frame sent its own records past the `redact` of the parent.
201
- - In Firefox, a `srcdoc` frame without a direct link finds its same-origin parent through the `origin` global of the parent. A `srcdoc` frame inside a `srcdoc` frame also finds it.
202
- - A `srcdoc` or `about:blank` parent sends a new security context to its direct children. Before, the next batch of such a child was dropped with only a `security.context_mismatch` count.
203
- - A `srcdoc` parent under `bus.sourcePolicy: "trusted-origin"` accepts its same-origin children. It also does not report them as untrusted.
204
- - A `srcdoc` forwarder accepts the sampling rules of its parent on the message link.
205
- - A replay snapshot that fails at an error no longer keeps the upload open. Before, each later event went to the replay endpoint with no end. Now the library sends no replay for that error and reports `capture.record_failed`.
206
- - A replay snapshot that fails halfway sends no part of itself. The buffer then waits for the next full snapshot, so an upload always starts with one.
207
- - A failed replay snapshot does not use an upload of `replay.uploadsPerWindow`.
208
- - The library reports a full replay buffer one time for each recording, also when the first snapshot is too large.
209
- - A new replay recording does not report the dropped events of an earlier recording.
210
- - The replay uploader sends no segment after a later call removes both `replay.endpoint` and `replay.onSegment`.
211
- - The mock ingest server no longer stops on a log record, a span or a metric point with no time. It prints `observedTimeUnixNano` for a log record, or `-` when the record has no time.
212
- - The mock ingest server answers `400` to a JSON body that does not have the expected shape. Before, that body stopped the server.
213
- - `docs/ingest-server.md` names `application/x-ndjson` for `serializer: "ecs"`. It says that `408` and each `5xx` make the library send the batch again.
5
+ ## [1.1.0] - 2026-11-22
6
+
7
+ A minor release. It has no breaking change. It captures clicks in popout windows, and it finds dead clicks on pages with live data. It gives each popup its own tab id. It also closes gaps in the loss reports of `shutdown()`, and it removes a limit on the signal endpoints.
8
+
9
+ ### Added - v1.1.0
10
+
11
+ - `observeWindow(target)` captures clicks, rage clicks and dead clicks in another window of the page with the same origin, for example a popout. It returns a function that stops the capture. The library does not capture a window from another origin.
12
+ - `capture.interactions.deadClickIgnoreSelector` names the regions that change on their own, for example a price cell. A change or a scroll inside such a region is not an answer to a click. The default is `[data-observability-live]`. `""` turns the filter off.
13
+ - The diagnostic code `bus.journey_denied`. The bus counts it for a journey request from a registered frame or worker without `journey:read`.
14
+ - The `tab` bus message has the optional field `since`. It holds the `performance.timeOrigin` of the document. An older library ignores it.
15
+ - `docs/guides.md` has the section "One Setup for All Specs". It configures the library one time in a Vitest setup file. No spec then needs a mock of the library.
16
+ - The `serializer` reference and the `LogSerializer` JSDoc tell that the library drops a batch that the server refuses with `400`. A custom serializer must keep each record within the limits of the server.
17
+ - `docs/configuration.md` tells that the spans of the library need no OpenTelemetry SDK.
18
+
19
+ ### Changed - v1.1.0
20
+
21
+ - A journey request from a registered frame or worker without `journey:read` does not count `bus.rejected_message` now. Each frame and worker with the default permissions sends one at startup.
22
+ - When the bus finds a duplicated tab id, the newer document makes a new tab id. The older document keeps its id. Before, the document with the larger random context id made a new id, or no document did.
23
+ - A write that keeps the old value of an attribute or a text is not an answer to a click. A batch that sets `name` or `type` and then puts back the old value is not an answer either.
24
+ - A swap of marked elements under one parent is not an answer to a click. A marked element that only appears or only goes away is an answer.
25
+ - Click capture checks the node type of the clicked element, not `instanceof Element`. A click on an element of another window is then recorded.
26
+ - `metricsEndpoint` and `tracesEndpoint` work with each `serializer`. Metric batches and span batches always use OTLP. Before, the `ecs` serializer or a custom serializer turned these endpoints off and reported `config.invalid`.
27
+ - With a custom serializer, the transport worker sends the metric batches and the span batches. The log batches still use the main thread.
28
+ - The package has no `engines` field. An install with `engine-strict` no longer fails on an older Node version. Use Node 22 or later. The tests run on Node 22.22.3.
29
+ - **Development:** `devEngines` in `package.json` sets Node 22.22.3 or later for this repository.
30
+ - **Development:** the workspace accepts the `@emnapi` versions that `oxc-parser` pins for `@napi-rs/wasm-runtime@1.2.7`. `pnpm peers check` passes.
31
+ - **Development:** GitHub CI runs the `verify` steps on the Node floor and on Node 24. It also builds the playgrounds and runs the playground tests, the browser tests and the playground smoke tests.
32
+ - **Development:** the Prettier config prints Markdown tables in compact form, with no column padding.
33
+ - **Development:** `playground/react-custom-backend` is a new example. A React 19 app sends its logs to its own backend through a custom `serializer`. `tools/mock-app-api.mjs` is its mock app API, with a login, prices and orders.
34
+ - **Development:** `playground/react` is now an FX workspace on `dockview-react` 8.9.1. It has a login, a saved layout for each user and tenant, popout windows, panel windows and 11 panels. It calls `observeWindow()` for each popout.
35
+ - **Development:** the replay player in `playground/react/src/replay-player/` replaces the replay spike and the replay viewer. The workspace does not install their rrweb packages now, so it does not declare the `@rrweb/types` peer.
36
+ - **Development:** `tools/mock-ingest-server.mjs` keeps replay segments in a bounded memory store. `GET /v1/replay/recordings` and `GET /v1/replay/recordings/<id>` read them.
37
+ - **Development:** the mock ingest server and the mock app API listen on `127.0.0.1` only. They refuse a `Host` header that is not `localhost` or `127.0.0.1`.
38
+ - **Development:** `tools/mock-app-api.mjs` has `POST /api/refresh` for the token refresh recipe.
39
+ - **Development:** `pnpm run test:playground` runs one Chromium smoke test for each playground app.
40
+ - **Development:** `e2e/observe-window.e2e.ts` checks `observeWindow()` with a real popup in Chromium, Firefox and WebKit.
41
+
42
+ ### Fixed - v1.1.0
43
+
44
+ - A popup that `window.open()` opens gets its own tab id at startup. Before, it kept the tab id that it copied from its opener.
45
+ - React's input writes no longer hide each `ui.dead_click`. React writes `name` and `type` at each render with no net change.
46
+ - With `diagnostics.records`, a diagnostic from the check of the next settings in a rotation goes to the new identity. An example is `config.invalid`. Before, the library dropped that record during the rotation.
47
+ - A `shutdown()` before the end of startup reports each held record to `onDrop` with `load_failed`. Before, with `bus: { mode: "off" }`, the library lost these records with no report.
48
+ - A `shutdown()` after the delivery stack loads, but before the end of startup, sends the startup records. Before, the library lost them with no report.
49
+ - A `shutdown()` during the sender load of a `carry` rotation rejects the rotation. `onDrop` reports the carried records in memory with `security_context`. Before, the rotation resolved, and the library lost the records with no report.
50
+ - A `shutdown({ clearStorage: "context" })` during that load removes the stored batches of the old context. Before, these batches stayed on the device.
51
+ - After a failed load of the delivery stack, `shutdown({ clearStorage })` still removes the stored batches that a `carry` rotation during a pause left.
52
+ - The testing examples in `docs/guides.md` and `llms.txt` call `memory.clear()` after `await shutdown()`. Before, the records that `shutdown()` sent reached the next test.
53
+ - `docs/configuration.md` and the `endpoint` JSDoc tell that a relative `endpoint` works. The library also reports `config.invalid` with the origin that gets the records.
54
+ - `docs/ingest-server.md` tells that the batches for `metricsEndpoint` and `tracesEndpoint` use OTLP with each `serializer`. This includes a `text/plain` exit batch.
55
+ - `docs/delivery-guarantees.md` tells how a `413` splits a batch. It also tells that the library loses an exit batch that gets a `413`, with no `onDrop` report.
56
+ - `docs/configuration.md` tells that an exit batch can hold more than `batching.logBatchSize` records.
57
+ - `docs/runtime-policies.md` tells that a full `payloadMode: "defer"` queue builds its pending calls inside the log call that finds it full.
58
+ - The "Logout on a shared device" recipe uses `clearStorage: "namespace"`. With `"context"`, the parked batches of earlier page loads stay on the device for `retention.maxAgeMs`.
59
+ - `docs/configuration.md` and `docs/threat-model.md` tell that the processors of the sender do not run on a record from a frame or a worker. Only `redact` runs on it again.
60
+ - `docs/threat-model.md` and `docs/production-recipes.md` tell that `shutdown()` removes each `registerFrame()` and `registerWorker()` registration.
61
+ - The "Consent withdrawal" recipe tells that a frame or a worker with its own `endpoint` becomes its own sender when the owner starts no bus.
62
+ - `CHANGELOG.md` has the 1.0.0 section one time. Before, it had that section two times.
63
+ - **Development:** the debug bundle test does not fail now when the random security context id holds "abc".
214
64
 
215
65
  ## [1.0.0] - 2026-11-20
216
66
 
@@ -943,16 +793,16 @@ configure({ endpoint, console: true });
943
793
  configure({ endpoint, console: "WARN" });
944
794
  ```
945
795
 
946
- | Section | Removed keys |
947
- | --------- | ------------------------------------------------------------------------------------------------------------------------- |
948
- | `streams` | `logs.batchSize`, `logs.flushIntervalMs`, `metrics.batchSize`, `metrics.flushIntervalMs` |
949
- | `retry` | `baseDelayMs`, `maxDelayMs`, `idleDelayMs` |
950
- | `journey` | `maxAgeMs`, `endOnOwnerClose`, `urlParam` |
951
- | `limits` | `maxBodyChars`, `maxAttributeChars`, `maxAttributeCount`, `maxStackChars`, `maxDepth`, `maxArrayLength`, `maxRecordBytes` |
952
- | `storage` | `dbName`, `maxBatches`, `maxAgeMs`, `maxAttempts` |
953
- | `bus` | `channelName`, `handshakeTimeoutMs`, `maxHandshakeAttempts`, `maxBootBufferRecords`, `openFinHost`, `orphanPolicy` |
954
- | `capture` | `maxBreadcrumbs`, `errorDedupeMs` |
955
- | top level | `maxConcurrentRequests`, `requestTimeoutMs`, `compressionThresholdBytes` |
796
+ | Section | Removed keys |
797
+ | --- | --- |
798
+ | `streams` | `logs.batchSize`, `logs.flushIntervalMs`, `metrics.batchSize`, `metrics.flushIntervalMs` |
799
+ | `retry` | `baseDelayMs`, `maxDelayMs`, `idleDelayMs` |
800
+ | `journey` | `maxAgeMs`, `endOnOwnerClose`, `urlParam` |
801
+ | `limits` | `maxBodyChars`, `maxAttributeChars`, `maxAttributeCount`, `maxStackChars`, `maxDepth`, `maxArrayLength`, `maxRecordBytes` |
802
+ | `storage` | `dbName`, `maxBatches`, `maxAgeMs`, `maxAttempts` |
803
+ | `bus` | `channelName`, `handshakeTimeoutMs`, `maxHandshakeAttempts`, `maxBootBufferRecords`, `openFinHost`, `orphanPolicy` |
804
+ | `capture` | `maxBreadcrumbs`, `errorDedupeMs` |
805
+ | top level | `maxConcurrentRequests`, `requestTimeoutMs`, `compressionThresholdBytes` |
956
806
 
957
807
  `sampling` is unchanged.
958
808
 
package/README.md CHANGED
@@ -23,9 +23,7 @@ pnpm add --save-exact @utk09/ui-observability
23
23
  yarn add --exact @utk09/ui-observability
24
24
  ```
25
25
 
26
- The package has an ES module entry and a CommonJS entry. Each entry has its own type declarations.
27
- The types work with `moduleResolution` set to `NodeNext` or `Bundler`. They also work with `skipLibCheck: false`.
28
- Use one module format in one application. The two entries are separate copies with separate state and separate types.
26
+ The package has an ES module entry and a CommonJS entry. Each entry has its own type declarations. The types work with `moduleResolution` set to `NodeNext` or `Bundler`. They also work with `skipLibCheck: false`. Use one module format in one application. The two entries are separate copies with separate state and separate types.
29
27
 
30
28
  ### Peer Dependencies
31
29
 
@@ -159,34 +157,34 @@ configure({
159
157
 
160
158
  ## Documentation
161
159
 
162
- | Document | Content |
163
- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
164
- | [API Reference](docs/api.md) | Each exported function, the delivery health, the flush result and the shutdown options. |
165
- | [Configuration Options](docs/configuration.md) | Each config key and its default, auto-capture, spans and the browser storage keys. |
166
- | [Guides](docs/guides.md) | Console output, custom transport, worker transport, testing and remote sampling. |
167
- | [Production recipes](docs/production-recipes.md) | Login, logout, tenant rotation, token refresh, consent withdrawal and the initialization order. |
168
- | [Ingest Server Requirements](docs/ingest-server.md) | The ingest contract and the `uiobs doctor` check of an ingest server. |
169
- | [Migration to 1.0.0](docs/migration-v1.md) | Each change from 0.12.x, with the new code. |
170
- | [Release and support](docs/release-and-support.md) | The stable API contract, the supported environments and the release evidence. |
171
- | [Runtime policies and migration](docs/runtime-policies.md) | Each default, each range, security-context rotation and the upgrade steps. |
172
- | [Delivery guarantees](docs/delivery-guarantees.md) | Duplicates, order, each loss and its `onDrop` reason, retention, the exit flush and rotation. |
173
- | [Attribute reference](docs/attributes.md) | Each attribute that the library writes, and its type. |
174
- | [Browser support](docs/browser-support.md) | The minimum browser versions, the browser APIs that the library uses, and the fallback for each. |
175
- | [Architecture](docs/architecture.md) | The core architecture, the layers of the library and the path of a record. |
176
- | [Threat model](docs/threat-model.md) | The trust boundaries, the threats and the controls. |
177
- | [Performance](docs/performance.md) | The release benchmark, its baselines and its budgets. |
178
- | [Development](docs/development.md) | The workspace, the checks and the example applications. |
179
- | [Browser tests](e2e/README.md) | The Playwright tests and the coverage that is still missing. |
180
- | [Collector check](e2e/collector/README.md) | The check against a pinned OpenTelemetry Collector. |
181
- | [Playground guide](playground/README.md) | The five example applications and how to start each one. |
182
- | [Security policy](SECURITY.md) | How to report a vulnerability. |
183
- | [llms.txt](llms.txt) | A summary of the library for a large language model. The package includes it. |
160
+ | Document | Content |
161
+ | --- | --- |
162
+ | [API Reference](docs/api.md) | Each exported function, the delivery health, the flush result and the shutdown options. |
163
+ | [Configuration Options](docs/configuration.md) | Each config key and its default, auto-capture, spans and the browser storage keys. |
164
+ | [Guides](docs/guides.md) | Console output, custom transport, worker transport, testing and remote sampling. |
165
+ | [Production recipes](docs/production-recipes.md) | Login, logout, tenant rotation, token refresh, consent withdrawal and the initialization order. |
166
+ | [Ingest Server Requirements](docs/ingest-server.md) | The ingest contract and the `uiobs doctor` check of an ingest server. |
167
+ | [Migration to 1.0.0](docs/migration-v1.md) | Each change from 0.12.x, with the new code. |
168
+ | [Release and support](docs/release-and-support.md) | The stable API contract, the supported environments and the release evidence. |
169
+ | [Runtime policies and migration](docs/runtime-policies.md) | Each default, each range, security-context rotation and the upgrade steps. |
170
+ | [Delivery guarantees](docs/delivery-guarantees.md) | Duplicates, order, each loss and its `onDrop` reason, retention, the exit flush and rotation. |
171
+ | [Attribute reference](docs/attributes.md) | Each attribute that the library writes, and its type. |
172
+ | [Browser support](docs/browser-support.md) | The minimum browser versions, the browser APIs that the library uses, and the fallback for each. |
173
+ | [Architecture](docs/architecture.md) | The core architecture, the layers of the library and the path of a record. |
174
+ | [Threat model](docs/threat-model.md) | The trust boundaries, the threats and the controls. |
175
+ | [Performance](docs/performance.md) | The release benchmark, its baselines and its budgets. |
176
+ | [Development](docs/development.md) | The workspace, the checks and the example applications. |
177
+ | [Browser tests](e2e/README.md) | The Playwright tests and the coverage that is still missing. |
178
+ | [Collector check](e2e/collector/README.md) | The check against a pinned OpenTelemetry Collector. |
179
+ | [Playground guide](playground/README.md) | The six example applications and how to start each one. |
180
+ | [Security policy](SECURITY.md) | How to report a vulnerability. |
181
+ | [llms.txt](llms.txt) | A summary of the library for a large language model. The package includes it. |
184
182
 
185
183
  ---
186
184
 
187
185
  ## Development
188
186
 
189
- Use Node 22.22.3 or later and pnpm 12.21.0.
187
+ To work on this repository, use Node 22.22.3 or later and pnpm 12.21.0. An app that uses the package can use Node 22 or later.
190
188
 
191
189
  ```bash
192
190
  pnpm install
@@ -1,5 +1,5 @@
1
- import { Nt as e, g as t } from "./constants-CUyd9cTZ.js";
2
- import { i as n } from "./identity-DdhKgrpk.js";
1
+ import { Pt as e, g as t } from "./constants-BwJDXzj6.js";
2
+ import { i as n } from "./identity-BgtHyY4u.js";
3
3
  // src/models/batch.ts
4
4
  function r(e) {
5
5
  if (typeof e != "object" || !e) return !1;
@@ -32,4 +32,4 @@ function s(e) {
32
32
  }
33
33
  export { i as a, r as i, s as n, o as r, a as t };
34
34
 
35
- //# sourceMappingURL=batch-CXmPmTse.js.map
35
+ //# sourceMappingURL=batch-D3NHhF9L.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"batch-CXmPmTse.js","names":["LOG_TYPE_ACTION","ATTR_LOG_TYPE","newId","isLogBatch","value","id","createdAt","attempts","records","splitBatch","batch","middle","halve","diagnostics","attributeOf","record","attributes","key","isActionRecord","countRecords","batches","total"],"sources":["../src/models/batch.ts"],"sourcesContent":["// src/models/batch.ts\n//\n// A batch of log records for delivery to the ingest endpoint.\n\nimport { ATTR_LOG_TYPE, LOG_TYPE_ACTION } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { newId } from \"../utils/identity\";\nimport type { LogRecord } from \"./log-record\";\n\n/**\n * A batch of records with a stable id used for server-side deduplication across retries.\n * @see {@link splitBatch}\n */\nexport interface LogBatch {\n /** Application namespace that owns this stored batch. */\n readonly persistenceNamespace?: string;\n /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */\n readonly routingContextId?: string;\n /** Deduplication key. Stays the same across retries and reloads. */\n id: string;\n /** Records to deliver, in log order. */\n records: LogRecord[];\n /** Batch creation time, in epoch milliseconds. */\n createdAt: number;\n /** Delivery attempts so far. */\n attempts: number;\n}\n\n/**\n * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry\n * without `id` after delivery, so that entry would be retried forever and block every batch\n * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so\n * it would never be dropped as a dead letter.\n * @param value Parsed storage entry.\n * @returns True when every required field is present and has the correct type.\n */\nexport function isLogBatch(value: unknown): value is LogBatch {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const id: unknown = Reflect.get(value, \"id\");\n const createdAt: unknown = Reflect.get(value, \"createdAt\");\n const attempts: unknown = Reflect.get(value, \"attempts\");\n const records: unknown = Reflect.get(value, \"records\");\n\n return (\n typeof id === \"string\" &&\n typeof createdAt === \"number\" &&\n typeof attempts === \"number\" &&\n Array.isArray(records)\n );\n}\n\n/**\n * Splits a batch that the server rejected as too large into two halves. Each half gets a new\n * id but keeps the original batch's age and attempts.\n * @param batch The rejected batch.\n * @param diagnostics Diagnostics reporter for the new batch ids.\n * @returns Two batches, or `null` if a single record is already over the limit.\n */\nexport function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null {\n if (batch.records.length < 2) {\n return null;\n }\n\n const middle = Math.floor(batch.records.length / 2);\n const halve = (records: LogRecord[]): LogBatch => ({\n id: newId(diagnostics),\n records,\n createdAt: batch.createdAt,\n attempts: batch.attempts,\n routingContextId: batch.routingContextId,\n persistenceNamespace: batch.persistenceNamespace,\n });\n\n return [halve(batch.records.slice(0, middle)), halve(batch.records.slice(middle))];\n}\n\n/**\n * Reads one attribute of a record. A record from storage can be corrupt, either null or\n * missing its attributes.\n * @param record Record to read.\n * @param key Attribute key.\n * @returns The attribute value, or undefined for a corrupt record.\n */\nexport function attributeOf(record: LogRecord, key: string): unknown {\n const value: unknown = record;\n if (typeof value !== \"object\" || value === null) {\n return undefined;\n }\n\n const attributes: unknown = Reflect.get(value, \"attributes\");\n if (typeof attributes !== \"object\" || attributes === null) {\n return undefined;\n }\n\n return Reflect.get(attributes, key);\n}\n\n/**\n * Checks whether a record is an action. A corrupt record from storage is not an action.\n * @param record Record to check.\n * @returns True for an action record.\n */\nexport function isActionRecord(record: LogRecord): boolean {\n return attributeOf(record, ATTR_LOG_TYPE) === LOG_TYPE_ACTION;\n}\n\n/**\n * Counts the records across all batches.\n * @param batches Batches to measure.\n * @returns Total record count.\n */\nexport function countRecords(batches: readonly LogBatch[]): number {\n return batches.reduce((total, batch) => total + batch.records.length, 0);\n}\n"],"mappings":";;;AAoCA,SAAgBG,EAAW,GAAmC;CAC5D,IAAI,OAAOC,KAAU,aAAYA,GAC/B,OAAO;CAGT,IAAMC,IAAc,QAAQ,IAAID,GAAO,IAAI,GACrCE,IAAqB,QAAQ,IAAIF,GAAO,WAAW,GACnDG,IAAoB,QAAQ,IAAIH,GAAO,UAAU,GACjDI,IAAmB,QAAQ,IAAIJ,GAAO,SAAS;CAErD,OACE,OAAOC,KAAO,YACd,OAAOC,KAAc,YACrB,OAAOC,KAAa,YACpB,MAAM,QAAQC,CAAO;AAEzB;AASA,SAAgBC,EAAW,GAAiB,GAAuD;CACjG,IAAIC,EAAM,QAAQ,SAAS,GACzB,OAAO;CAGT,IAAMC,IAAS,KAAK,MAAMD,EAAM,QAAQ,SAAS,CAAC,GAC5CE,KAAS,OAAoC;EACjD,IAAIV,EAAMW,CAAW;EACrB;EACA,WAAWH,EAAM;EACjB,UAAUA,EAAM;EAChB,kBAAkBA,EAAM;EACxB,sBAAsBA,EAAM;CAC9B;CAEA,OAAO,CAACE,EAAMF,EAAM,QAAQ,MAAM,GAAGC,CAAM,CAAC,GAAGC,EAAMF,EAAM,QAAQ,MAAMC,CAAM,CAAC,CAAC;AACnF;AASA,SAAgBG,EAAY,GAAmB,GAAsB;CACnE,IAAMV,IAAiBW;CACvB,IAAI,OAAOX,KAAU,aAAYA,GAC/B;CAGF,IAAMY,IAAsB,QAAQ,IAAIZ,GAAO,YAAY;CAC3D,IAAI,OAAOY,KAAe,YAAYA,GAItC,OAAO,QAAQ,IAAIA,GAAYC,CAAG;AACpC;AAOA,SAAgBC,EAAe,GAA4B;CACzD,OAAOJ,EAAYC,GAAQd,CAAa,MAAMD;AAChD;AAOA,SAAgBmB,EAAa,GAAsC;CACjE,OAAOC,EAAQ,QAAQ,GAAO,MAAUC,IAAQX,EAAM,QAAQ,QAAQ,CAAC;AACzE"}
1
+ {"version":3,"file":"batch-D3NHhF9L.js","names":["LOG_TYPE_ACTION","ATTR_LOG_TYPE","newId","isLogBatch","value","id","createdAt","attempts","records","splitBatch","batch","middle","halve","diagnostics","attributeOf","record","attributes","key","isActionRecord","countRecords","batches","total"],"sources":["../src/models/batch.ts"],"sourcesContent":["// src/models/batch.ts\n//\n// A batch of log records for delivery to the ingest endpoint.\n\nimport { ATTR_LOG_TYPE, LOG_TYPE_ACTION } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { newId } from \"../utils/identity\";\nimport type { LogRecord } from \"./log-record\";\n\n/**\n * A batch of records with a stable id used for server-side deduplication across retries.\n * @see {@link splitBatch}\n */\nexport interface LogBatch {\n /** Application namespace that owns this stored batch. */\n readonly persistenceNamespace?: string;\n /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */\n readonly routingContextId?: string;\n /** Deduplication key. Stays the same across retries and reloads. */\n id: string;\n /** Records to deliver, in log order. */\n records: LogRecord[];\n /** Batch creation time, in epoch milliseconds. */\n createdAt: number;\n /** Delivery attempts so far. */\n attempts: number;\n}\n\n/**\n * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry\n * without `id` after delivery, so that entry would be retried forever and block every batch\n * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so\n * it would never be dropped as a dead letter.\n * @param value Parsed storage entry.\n * @returns True when every required field is present and has the correct type.\n */\nexport function isLogBatch(value: unknown): value is LogBatch {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const id: unknown = Reflect.get(value, \"id\");\n const createdAt: unknown = Reflect.get(value, \"createdAt\");\n const attempts: unknown = Reflect.get(value, \"attempts\");\n const records: unknown = Reflect.get(value, \"records\");\n\n return (\n typeof id === \"string\" &&\n typeof createdAt === \"number\" &&\n typeof attempts === \"number\" &&\n Array.isArray(records)\n );\n}\n\n/**\n * Splits a batch that the server rejected as too large into two halves. Each half gets a new\n * id but keeps the original batch's age and attempts.\n * @param batch The rejected batch.\n * @param diagnostics Diagnostics reporter for the new batch ids.\n * @returns Two batches, or `null` if a single record is already over the limit.\n */\nexport function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null {\n if (batch.records.length < 2) {\n return null;\n }\n\n const middle = Math.floor(batch.records.length / 2);\n const halve = (records: LogRecord[]): LogBatch => ({\n id: newId(diagnostics),\n records,\n createdAt: batch.createdAt,\n attempts: batch.attempts,\n routingContextId: batch.routingContextId,\n persistenceNamespace: batch.persistenceNamespace,\n });\n\n return [halve(batch.records.slice(0, middle)), halve(batch.records.slice(middle))];\n}\n\n/**\n * Reads one attribute of a record. A record from storage can be corrupt, either null or\n * missing its attributes.\n * @param record Record to read.\n * @param key Attribute key.\n * @returns The attribute value, or undefined for a corrupt record.\n */\nexport function attributeOf(record: LogRecord, key: string): unknown {\n const value: unknown = record;\n if (typeof value !== \"object\" || value === null) {\n return undefined;\n }\n\n const attributes: unknown = Reflect.get(value, \"attributes\");\n if (typeof attributes !== \"object\" || attributes === null) {\n return undefined;\n }\n\n return Reflect.get(attributes, key);\n}\n\n/**\n * Checks whether a record is an action. A corrupt record from storage is not an action.\n * @param record Record to check.\n * @returns True for an action record.\n */\nexport function isActionRecord(record: LogRecord): boolean {\n return attributeOf(record, ATTR_LOG_TYPE) === LOG_TYPE_ACTION;\n}\n\n/**\n * Counts the records across all batches.\n * @param batches Batches to measure.\n * @returns Total record count.\n */\nexport function countRecords(batches: readonly LogBatch[]): number {\n return batches.reduce((total, batch) => total + batch.records.length, 0);\n}\n"],"mappings":";;;AAoCA,SAAgBG,EAAW,GAAmC;CAC5D,IAAI,OAAOC,KAAU,aAAYA,GAC/B,OAAO;CAGT,IAAMC,IAAc,QAAQ,IAAID,GAAO,IAAI,GACrCE,IAAqB,QAAQ,IAAIF,GAAO,WAAW,GACnDG,IAAoB,QAAQ,IAAIH,GAAO,UAAU,GACjDI,IAAmB,QAAQ,IAAIJ,GAAO,SAAS;CAErD,OACE,OAAOC,KAAO,YACd,OAAOC,KAAc,YACrB,OAAOC,KAAa,YACpB,MAAM,QAAQC,CAAO;AAEzB;AASA,SAAgBC,EAAW,GAAiB,GAAuD;CACjG,IAAIC,EAAM,QAAQ,SAAS,GACzB,OAAO;CAGT,IAAMC,IAAS,KAAK,MAAMD,EAAM,QAAQ,SAAS,CAAC,GAC5CE,KAAS,OAAoC;EACjD,IAAIV,EAAMW,CAAW;EACrB;EACA,WAAWH,EAAM;EACjB,UAAUA,EAAM;EAChB,kBAAkBA,EAAM;EACxB,sBAAsBA,EAAM;CAC9B;CAEA,OAAO,CAACE,EAAMF,EAAM,QAAQ,MAAM,GAAGC,CAAM,CAAC,GAAGC,EAAMF,EAAM,QAAQ,MAAMC,CAAM,CAAC,CAAC;AACnF;AASA,SAAgBG,EAAY,GAAmB,GAAsB;CACnE,IAAMV,IAAiBW;CACvB,IAAI,OAAOX,KAAU,aAAYA,GAC/B;CAGF,IAAMY,IAAsB,QAAQ,IAAIZ,GAAO,YAAY;CAC3D,IAAI,OAAOY,KAAe,YAAYA,GAItC,OAAO,QAAQ,IAAIA,GAAYC,CAAG;AACpC;AAOA,SAAgBC,EAAe,GAA4B;CACzD,OAAOJ,EAAYC,GAAQd,CAAa,MAAMD;AAChD;AAOA,SAAgBmB,EAAa,GAAsC;CACjE,OAAOC,EAAQ,QAAQ,GAAO,MAAUC,IAAQX,EAAM,QAAQ,QAAQ,CAAC;AACzE"}
@@ -1,2 +1,2 @@
1
- const e=require("./constants-CqdJhTxH.cjs"),t=require("./identity-DlWRIuwy.cjs");function n(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`id`),n=Reflect.get(e,`createdAt`),r=Reflect.get(e,`attempts`),i=Reflect.get(e,`records`);return typeof t==`string`&&typeof n==`number`&&typeof r==`number`&&Array.isArray(i)}function r(e,n){if(e.records.length<2)return null;let r=Math.floor(e.records.length/2),i=r=>({id:t.i(n),records:r,createdAt:e.createdAt,attempts:e.attempts,routingContextId:e.routingContextId,persistenceNamespace:e.persistenceNamespace});return[i(e.records.slice(0,r)),i(e.records.slice(r))]}function i(e,t){let n=e;if(typeof n!=`object`||!n)return;let r=Reflect.get(n,`attributes`);if(typeof r==`object`&&r)return Reflect.get(r,t)}function a(t){return i(t,e.g)===e.Nt}function o(e){return e.reduce((e,t)=>e+t.records.length,0)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
2
- //# sourceMappingURL=batch-mmPigCpi.cjs.map
1
+ const e=require("./constants-CtF52hIV.cjs"),t=require("./identity-CvuyqZk7.cjs");function n(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`id`),n=Reflect.get(e,`createdAt`),r=Reflect.get(e,`attempts`),i=Reflect.get(e,`records`);return typeof t==`string`&&typeof n==`number`&&typeof r==`number`&&Array.isArray(i)}function r(e,n){if(e.records.length<2)return null;let r=Math.floor(e.records.length/2),i=r=>({id:t.i(n),records:r,createdAt:e.createdAt,attempts:e.attempts,routingContextId:e.routingContextId,persistenceNamespace:e.persistenceNamespace});return[i(e.records.slice(0,r)),i(e.records.slice(r))]}function i(e,t){let n=e;if(typeof n!=`object`||!n)return;let r=Reflect.get(n,`attributes`);if(typeof r==`object`&&r)return Reflect.get(r,t)}function a(t){return i(t,e.g)===e.Pt}function o(e){return e.reduce((e,t)=>e+t.records.length,0)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}});
2
+ //# sourceMappingURL=batch-DnYRJqhU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"batch-mmPigCpi.cjs","names":["newId","ATTR_LOG_TYPE","LOG_TYPE_ACTION","require_constants","require_identity","isLogBatch","value","id","createdAt","attempts","records","splitBatch","batch","middle","halve","diagnostics","attributeOf","record","attributes","key","isActionRecord","countRecords","batches","total"],"sources":["../src/models/batch.ts"],"sourcesContent":["// src/models/batch.ts\n//\n// A batch of log records for delivery to the ingest endpoint.\n\nimport { ATTR_LOG_TYPE, LOG_TYPE_ACTION } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { newId } from \"../utils/identity\";\nimport type { LogRecord } from \"./log-record\";\n\n/**\n * A batch of records with a stable id used for server-side deduplication across retries.\n * @see {@link splitBatch}\n */\nexport interface LogBatch {\n /** Application namespace that owns this stored batch. */\n readonly persistenceNamespace?: string;\n /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */\n readonly routingContextId?: string;\n /** Deduplication key. Stays the same across retries and reloads. */\n id: string;\n /** Records to deliver, in log order. */\n records: LogRecord[];\n /** Batch creation time, in epoch milliseconds. */\n createdAt: number;\n /** Delivery attempts so far. */\n attempts: number;\n}\n\n/**\n * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry\n * without `id` after delivery, so that entry would be retried forever and block every batch\n * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so\n * it would never be dropped as a dead letter.\n * @param value Parsed storage entry.\n * @returns True when every required field is present and has the correct type.\n */\nexport function isLogBatch(value: unknown): value is LogBatch {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const id: unknown = Reflect.get(value, \"id\");\n const createdAt: unknown = Reflect.get(value, \"createdAt\");\n const attempts: unknown = Reflect.get(value, \"attempts\");\n const records: unknown = Reflect.get(value, \"records\");\n\n return (\n typeof id === \"string\" &&\n typeof createdAt === \"number\" &&\n typeof attempts === \"number\" &&\n Array.isArray(records)\n );\n}\n\n/**\n * Splits a batch that the server rejected as too large into two halves. Each half gets a new\n * id but keeps the original batch's age and attempts.\n * @param batch The rejected batch.\n * @param diagnostics Diagnostics reporter for the new batch ids.\n * @returns Two batches, or `null` if a single record is already over the limit.\n */\nexport function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null {\n if (batch.records.length < 2) {\n return null;\n }\n\n const middle = Math.floor(batch.records.length / 2);\n const halve = (records: LogRecord[]): LogBatch => ({\n id: newId(diagnostics),\n records,\n createdAt: batch.createdAt,\n attempts: batch.attempts,\n routingContextId: batch.routingContextId,\n persistenceNamespace: batch.persistenceNamespace,\n });\n\n return [halve(batch.records.slice(0, middle)), halve(batch.records.slice(middle))];\n}\n\n/**\n * Reads one attribute of a record. A record from storage can be corrupt, either null or\n * missing its attributes.\n * @param record Record to read.\n * @param key Attribute key.\n * @returns The attribute value, or undefined for a corrupt record.\n */\nexport function attributeOf(record: LogRecord, key: string): unknown {\n const value: unknown = record;\n if (typeof value !== \"object\" || value === null) {\n return undefined;\n }\n\n const attributes: unknown = Reflect.get(value, \"attributes\");\n if (typeof attributes !== \"object\" || attributes === null) {\n return undefined;\n }\n\n return Reflect.get(attributes, key);\n}\n\n/**\n * Checks whether a record is an action. A corrupt record from storage is not an action.\n * @param record Record to check.\n * @returns True for an action record.\n */\nexport function isActionRecord(record: LogRecord): boolean {\n return attributeOf(record, ATTR_LOG_TYPE) === LOG_TYPE_ACTION;\n}\n\n/**\n * Counts the records across all batches.\n * @param batches Batches to measure.\n * @returns Total record count.\n */\nexport function countRecords(batches: readonly LogBatch[]): number {\n return batches.reduce((total, batch) => total + batch.records.length, 0);\n}\n"],"mappings":"A,iFAoCA,SAAgBK,EAAW,EAAmC,CAC5D,GAAI,OAAOC,GAAU,WAAYA,EAC/B,MAAO,GAGT,IAAMC,EAAc,QAAQ,IAAID,EAAO,IAAI,EACrCE,EAAqB,QAAQ,IAAIF,EAAO,WAAW,EACnDG,EAAoB,QAAQ,IAAIH,EAAO,UAAU,EACjDI,EAAmB,QAAQ,IAAIJ,EAAO,SAAS,EAErD,OACE,OAAOC,GAAO,UACd,OAAOC,GAAc,UACrB,OAAOC,GAAa,UACpB,MAAM,QAAQC,CAAO,CAEzB,CASA,SAAgBC,EAAW,EAAiB,EAAuD,CACjG,GAAIC,EAAM,QAAQ,OAAS,EACzB,OAAO,KAGT,IAAMC,EAAS,KAAK,MAAMD,EAAM,QAAQ,OAAS,CAAC,EAC5CE,EAAS,IAAoC,CACjD,GAAId,EAAAA,EAAMe,CAAW,EACrB,UACA,UAAWH,EAAM,UACjB,SAAUA,EAAM,SAChB,iBAAkBA,EAAM,iBACxB,qBAAsBA,EAAM,oBAC9B,GAEA,MAAO,CAACE,EAAMF,EAAM,QAAQ,MAAM,EAAGC,CAAM,CAAC,EAAGC,EAAMF,EAAM,QAAQ,MAAMC,CAAM,CAAC,CAAC,CACnF,CASA,SAAgBG,EAAY,EAAmB,EAAsB,CACnE,IAAMV,EAAiBW,EACvB,GAAI,OAAOX,GAAU,WAAYA,EAC/B,OAGF,IAAMY,EAAsB,QAAQ,IAAIZ,EAAO,YAAY,EAC3D,GAAI,OAAOY,GAAe,UAAYA,EAItC,OAAO,QAAQ,IAAIA,EAAYC,CAAG,CACpC,CAOA,SAAgBC,EAAe,EAA4B,CACzD,OAAOJ,EAAYC,EAAQhB,EAAAA,CAAa,IAAMC,EAAAA,EAChD,CAOA,SAAgBmB,EAAa,EAAsC,CACjE,OAAOC,EAAQ,QAAQ,EAAO,IAAUC,EAAQX,EAAM,QAAQ,OAAQ,CAAC,CACzE,C"}
1
+ {"version":3,"file":"batch-DnYRJqhU.cjs","names":["newId","ATTR_LOG_TYPE","LOG_TYPE_ACTION","require_constants","require_identity","isLogBatch","value","id","createdAt","attempts","records","splitBatch","batch","middle","halve","diagnostics","attributeOf","record","attributes","key","isActionRecord","countRecords","batches","total"],"sources":["../src/models/batch.ts"],"sourcesContent":["// src/models/batch.ts\n//\n// A batch of log records for delivery to the ingest endpoint.\n\nimport { ATTR_LOG_TYPE, LOG_TYPE_ACTION } from \"../constants\";\nimport type { Diagnostics } from \"../core/diagnostics\";\nimport { newId } from \"../utils/identity\";\nimport type { LogRecord } from \"./log-record\";\n\n/**\n * A batch of records with a stable id used for server-side deduplication across retries.\n * @see {@link splitBatch}\n */\nexport interface LogBatch {\n /** Application namespace that owns this stored batch. */\n readonly persistenceNamespace?: string;\n /** Delivery context id. Never changes. With isolation, a batch without one stays stored. */\n readonly routingContextId?: string;\n /** Deduplication key. Stays the same across retries and reloads. */\n id: string;\n /** Records to deliver, in log order. */\n records: LogRecord[];\n /** Batch creation time, in epoch milliseconds. */\n createdAt: number;\n /** Delivery attempts so far. */\n attempts: number;\n}\n\n/**\n * Checks whether a value from storage has every field of a batch. `keyOf` can't match an entry\n * without `id` after delivery, so that entry would be retried forever and block every batch\n * behind it. An entry without `attempts` counts as NaN, which never reaches `maxAttempts`, so\n * it would never be dropped as a dead letter.\n * @param value Parsed storage entry.\n * @returns True when every required field is present and has the correct type.\n */\nexport function isLogBatch(value: unknown): value is LogBatch {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const id: unknown = Reflect.get(value, \"id\");\n const createdAt: unknown = Reflect.get(value, \"createdAt\");\n const attempts: unknown = Reflect.get(value, \"attempts\");\n const records: unknown = Reflect.get(value, \"records\");\n\n return (\n typeof id === \"string\" &&\n typeof createdAt === \"number\" &&\n typeof attempts === \"number\" &&\n Array.isArray(records)\n );\n}\n\n/**\n * Splits a batch that the server rejected as too large into two halves. Each half gets a new\n * id but keeps the original batch's age and attempts.\n * @param batch The rejected batch.\n * @param diagnostics Diagnostics reporter for the new batch ids.\n * @returns Two batches, or `null` if a single record is already over the limit.\n */\nexport function splitBatch(batch: LogBatch, diagnostics: Diagnostics): [LogBatch, LogBatch] | null {\n if (batch.records.length < 2) {\n return null;\n }\n\n const middle = Math.floor(batch.records.length / 2);\n const halve = (records: LogRecord[]): LogBatch => ({\n id: newId(diagnostics),\n records,\n createdAt: batch.createdAt,\n attempts: batch.attempts,\n routingContextId: batch.routingContextId,\n persistenceNamespace: batch.persistenceNamespace,\n });\n\n return [halve(batch.records.slice(0, middle)), halve(batch.records.slice(middle))];\n}\n\n/**\n * Reads one attribute of a record. A record from storage can be corrupt, either null or\n * missing its attributes.\n * @param record Record to read.\n * @param key Attribute key.\n * @returns The attribute value, or undefined for a corrupt record.\n */\nexport function attributeOf(record: LogRecord, key: string): unknown {\n const value: unknown = record;\n if (typeof value !== \"object\" || value === null) {\n return undefined;\n }\n\n const attributes: unknown = Reflect.get(value, \"attributes\");\n if (typeof attributes !== \"object\" || attributes === null) {\n return undefined;\n }\n\n return Reflect.get(attributes, key);\n}\n\n/**\n * Checks whether a record is an action. A corrupt record from storage is not an action.\n * @param record Record to check.\n * @returns True for an action record.\n */\nexport function isActionRecord(record: LogRecord): boolean {\n return attributeOf(record, ATTR_LOG_TYPE) === LOG_TYPE_ACTION;\n}\n\n/**\n * Counts the records across all batches.\n * @param batches Batches to measure.\n * @returns Total record count.\n */\nexport function countRecords(batches: readonly LogBatch[]): number {\n return batches.reduce((total, batch) => total + batch.records.length, 0);\n}\n"],"mappings":"A,iFAoCA,SAAgBK,EAAW,EAAmC,CAC5D,GAAI,OAAOC,GAAU,WAAYA,EAC/B,MAAO,GAGT,IAAMC,EAAc,QAAQ,IAAID,EAAO,IAAI,EACrCE,EAAqB,QAAQ,IAAIF,EAAO,WAAW,EACnDG,EAAoB,QAAQ,IAAIH,EAAO,UAAU,EACjDI,EAAmB,QAAQ,IAAIJ,EAAO,SAAS,EAErD,OACE,OAAOC,GAAO,UACd,OAAOC,GAAc,UACrB,OAAOC,GAAa,UACpB,MAAM,QAAQC,CAAO,CAEzB,CASA,SAAgBC,EAAW,EAAiB,EAAuD,CACjG,GAAIC,EAAM,QAAQ,OAAS,EACzB,OAAO,KAGT,IAAMC,EAAS,KAAK,MAAMD,EAAM,QAAQ,OAAS,CAAC,EAC5CE,EAAS,IAAoC,CACjD,GAAId,EAAAA,EAAMe,CAAW,EACrB,UACA,UAAWH,EAAM,UACjB,SAAUA,EAAM,SAChB,iBAAkBA,EAAM,iBACxB,qBAAsBA,EAAM,oBAC9B,GAEA,MAAO,CAACE,EAAMF,EAAM,QAAQ,MAAM,EAAGC,CAAM,CAAC,EAAGC,EAAMF,EAAM,QAAQ,MAAMC,CAAM,CAAC,CAAC,CACnF,CASA,SAAgBG,EAAY,EAAmB,EAAsB,CACnE,IAAMV,EAAiBW,EACvB,GAAI,OAAOX,GAAU,WAAYA,EAC/B,OAGF,IAAMY,EAAsB,QAAQ,IAAIZ,EAAO,YAAY,EAC3D,GAAI,OAAOY,GAAe,UAAYA,EAItC,OAAO,QAAQ,IAAIA,EAAYC,CAAG,CACpC,CAOA,SAAgBC,EAAe,EAA4B,CACzD,OAAOJ,EAAYC,EAAQhB,EAAAA,CAAa,IAAMC,EAAAA,EAChD,CAOA,SAAgBmB,EAAa,EAAsC,CACjE,OAAOC,EAAQ,QAAQ,EAAO,IAAUC,EAAQX,EAAM,QAAQ,OAAQ,CAAC,CACzE,C"}
@@ -50,7 +50,7 @@ export declare class Bus {
50
50
  private readonly diagnostics;
51
51
  private readonly platform;
52
52
  private readonly contextId;
53
- private readonly tabId;
53
+ private tabId;
54
54
  private readonly handlers;
55
55
  private readonly handshakeOptions;
56
56
  /** Window and worker registrations with their permissions. */
@@ -88,6 +88,12 @@ export declare class Bus {
88
88
  * own context.
89
89
  */
90
90
  rotateContext(): void;
91
+ /**
92
+ * Switches to the tab id that the runtime made after a clash. Without it, the next claim,
93
+ * hello and comparison use the old id.
94
+ * @param tabId The new tab id.
95
+ */
96
+ setTabId(tabId: string): void;
91
97
  /**
92
98
  * Sends the context id to child frames and workers.
93
99
  * @param openFin True to send it to OpenFin views too.
@@ -134,6 +140,11 @@ export declare class Bus {
134
140
  private flushing;
135
141
  /** Epoch time in milliseconds when the last flush for a child started. */
136
142
  private flushedAt;
143
+ /**
144
+ * The document's performance.timeOrigin, read once so each claim and comparison uses one
145
+ * value. Undefined when the browser gives no finite number.
146
+ */
147
+ private readonly since;
137
148
  /**
138
149
  * @param config Active configuration instance.
139
150
  * @param diagnostics Diagnostics reporter.
@@ -206,7 +217,8 @@ export declare class Bus {
206
217
  * @param message Message from the source.
207
218
  * @param source Link and identity of the source.
208
219
  * @param child True if the source is a child of this context.
209
- * @returns True if the message passes every check.
220
+ * @returns True if the message passes every check, or "journey_denied" for a journey request
221
+ * from a registered source without journey:read.
210
222
  */
211
223
  private passesChecks;
212
224
  /**
@@ -215,6 +227,12 @@ export declare class Bus {
215
227
  * @param source Link and identity of the source.
216
228
  */
217
229
  private routeMessage;
230
+ /**
231
+ * Settles another document's claim on this tab id. The older document keeps the id, because
232
+ * window.open and a duplicated tab copy it into the newer one.
233
+ * @param claim The other document's claim on the same tab id.
234
+ */
235
+ private settleTabClaim;
218
236
  /**
219
237
  * Queues a child's flush request. The first request runs its flush alone, and the requests
220
238
  * that arrive meanwhile share one flush after it, so a flood has one flush running at most.
@@ -271,6 +289,12 @@ export declare class Bus {
271
289
  * @returns True if the welcome arrived before the timeout.
272
290
  */
273
291
  private handshake;
292
+ /**
293
+ * Builds this context's tab claim. An unknown start time stays out of the claim, so the
294
+ * receiver falls back to the id comparison.
295
+ * @returns The claim.
296
+ */
297
+ private tabClaim;
274
298
  /** Broadcasts tab claim and queries existing journey state. */
275
299
  private announce;
276
300
  /**