@dittolive/ditto 4.5.1 → 4.5.2-rc.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.
Files changed (486) hide show
  1. package/DittoReactNative.podspec +2 -5
  2. package/README.md +2 -2
  3. package/node/ditto.cjs.js +2 -9653
  4. package/node/ditto.cjs.js.map +1 -0
  5. package/node/ditto.cjs.pretty.js +9655 -0
  6. package/node/ditto.cjs.pretty.js.map +1 -0
  7. package/node/ditto.darwin-arm64.node +0 -0
  8. package/node/ditto.darwin-x64.node +0 -0
  9. package/node/ditto.linux-x64.node +0 -0
  10. package/node/transports.darwin-arm64.node +0 -0
  11. package/node/transports.darwin-x64.node +0 -0
  12. package/package.json +31 -26
  13. package/react-native/android/build.gradle +2 -19
  14. package/react-native/cpp/include/Arc.hpp +141 -0
  15. package/react-native/cpp/include/Lifecycle.h +2 -1
  16. package/react-native/cpp/include/Misc.h +2 -1
  17. package/react-native/cpp/include/SmallPeerInfo.h +2 -0
  18. package/react-native/cpp/src/Authentication.cpp +17 -14
  19. package/react-native/cpp/src/DQL.cpp +10 -8
  20. package/react-native/cpp/src/Lifecycle.cpp +37 -2
  21. package/react-native/cpp/src/LiveQuery.cpp +2 -3
  22. package/react-native/cpp/src/Misc.cpp +15 -3
  23. package/react-native/cpp/src/Presence.cpp +8 -6
  24. package/react-native/cpp/src/SmallPeerInfo.cpp +34 -0
  25. package/react-native/cpp/src/main.cpp +6 -3
  26. package/react-native/dittoffi/dittoffi.h +186 -184
  27. package/react-native/lib/commonjs/ditto.rn.js +14 -15
  28. package/react-native/lib/commonjs/ditto.rn.js.map +1 -1
  29. package/react-native/lib/commonjs/index.js +61 -14
  30. package/react-native/lib/commonjs/index.js.map +1 -1
  31. package/react-native/lib/module/ditto.rn.js +16 -11
  32. package/react-native/lib/module/ditto.rn.js.map +1 -1
  33. package/react-native/lib/module/index.js +24 -10
  34. package/react-native/lib/module/index.js.map +1 -1
  35. package/react-native/lib/typescript/ditto.rn.d.ts.map +1 -1
  36. package/react-native/src/sources/@environment.ts +0 -1
  37. package/react-native/src/sources/attachment-fetcher-manager.ts +15 -0
  38. package/react-native/src/sources/attachment-fetcher.ts +10 -0
  39. package/react-native/src/sources/attachment.ts +15 -0
  40. package/react-native/src/sources/augment.ts +12 -0
  41. package/react-native/src/sources/base-pending-cursor-operation.ts +2 -0
  42. package/react-native/src/sources/bridge.ts +5 -1
  43. package/react-native/src/sources/build-time-constants.ts +5 -1
  44. package/react-native/src/sources/counter.ts +5 -0
  45. package/react-native/src/sources/ditto.ts +46 -12
  46. package/react-native/src/sources/document-id.ts +1 -1
  47. package/react-native/src/sources/document-path.ts +5 -2
  48. package/react-native/src/sources/document.ts +2 -1
  49. package/react-native/src/sources/epilogue.ts +6 -0
  50. package/react-native/src/sources/error.ts +7 -2
  51. package/react-native/src/sources/ffi-error.ts +6 -1
  52. package/react-native/src/sources/ffi.ts +51 -11
  53. package/react-native/src/sources/init.ts +2 -1
  54. package/react-native/src/sources/internal.ts +3 -7
  55. package/react-native/src/sources/keep-alive.ts +6 -2
  56. package/react-native/src/sources/key-path.ts +4 -1
  57. package/react-native/src/sources/live-query-manager.ts +5 -4
  58. package/react-native/src/sources/live-query.ts +2 -0
  59. package/react-native/src/sources/main.ts +60 -0
  60. package/react-native/src/sources/observer-manager.ts +5 -2
  61. package/react-native/src/sources/observer.ts +3 -1
  62. package/react-native/src/sources/pending-id-specific-operation.ts +4 -2
  63. package/react-native/src/sources/presence-manager.ts +2 -1
  64. package/react-native/src/sources/presence.ts +0 -5
  65. package/react-native/src/sources/register.ts +5 -2
  66. package/react-native/src/sources/small-peer-info.ts +1 -0
  67. package/react-native/src/sources/store-observer.ts +1 -0
  68. package/react-native/src/sources/store.ts +24 -4
  69. package/react-native/src/sources/subscription-manager.ts +2 -1
  70. package/react-native/src/sources/subscription.ts +1 -0
  71. package/react-native/src/sources/sync.ts +110 -46
  72. package/react-native/src/sources/transport-config.ts +2 -0
  73. package/react-native/src/sources/websocket-client.ts +1 -0
  74. package/react-native/src/sources/write-transaction-pending-id-specific-operation.ts +2 -0
  75. package/react-native/src/sources/write-transaction.ts +2 -0
  76. package/types/ditto.d.ts.map +1 -0
  77. package/web/ditto.es6.js +1 -1
  78. package/web/ditto.es6.js.map +1 -0
  79. package/web/ditto.es6.pretty.js +12600 -0
  80. package/web/ditto.es6.pretty.js.map +1 -0
  81. package/web/ditto.umd.js +1 -1
  82. package/web/ditto.umd.js.map +1 -0
  83. package/web/ditto.umd.pretty.js +12669 -0
  84. package/web/ditto.umd.pretty.js.map +1 -0
  85. package/web/ditto.wasm +0 -0
  86. package/node/ditto.linux-arm.node +0 -0
  87. package/node/ditto.win32-x64.node +0 -0
  88. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  89. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  90. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  91. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/reply/cache-v2-970081f7c58ab1625a1a.json +0 -1303
  92. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/reply/cmakeFiles-v1-e1bacde094ce7e389294.json +0 -203
  93. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/reply/codemodel-v2-54964c7f44134b1cec4d.json +0 -60
  94. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json +0 -14
  95. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/reply/index-2023-12-06T19-58-48-0479.json +0 -92
  96. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.cmake/api/v1/reply/target-cpp-Debug-a438adda6ad6df71f898.json +0 -314
  97. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.ninja_deps +0 -0
  98. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/.ninja_log +0 -21
  99. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeCache.txt +0 -393
  100. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake +0 -79
  101. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake +0 -90
  102. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin +0 -0
  103. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin +0 -0
  104. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake +0 -113
  105. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.c +0 -803
  106. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o +0 -0
  107. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
  108. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  109. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/CMakeOutput.log +0 -320
  110. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/TargetDirectories.txt +0 -3
  111. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cmake.check_cache +0 -1
  112. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Attachment.cpp.o +0 -0
  113. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Authentication.cpp.o +0 -0
  114. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Collection.cpp.o +0 -0
  115. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/DQL.cpp.o +0 -0
  116. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Document.cpp.o +0 -0
  117. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Identity.cpp.o +0 -0
  118. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Lifecycle.cpp.o +0 -0
  119. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/LiveQuery.cpp.o +0 -0
  120. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Logger.cpp.o +0 -0
  121. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Misc.cpp.o +0 -0
  122. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Presence.cpp.o +0 -0
  123. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/RetainableState.cpp.o +0 -0
  124. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/SmallPeerInfo.cpp.o +0 -0
  125. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Transports.cpp.o +0 -0
  126. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/TypedArray.cpp.o +0 -0
  127. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Utils.cpp.o +0 -0
  128. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/main.cpp.o +0 -0
  129. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/dittoffi/ifaddrs.cpp.o +0 -0
  130. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/cpp.dir/cpp-adapter.cpp.o +0 -0
  131. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/CMakeFiles/rules.ninja +0 -64
  132. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/additional_project_files.txt +0 -0
  133. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/android_gradle_build.json +0 -42
  134. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/android_gradle_build_mini.json +0 -31
  135. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/build.ninja +0 -297
  136. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/build_file_index.txt +0 -3
  137. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/cmake_install.cmake +0 -54
  138. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/compile_commands.json +0 -97
  139. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/compile_commands.json.bin +0 -0
  140. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/configure_fingerprint.bin +0 -8755
  141. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/metadata_generation_command.txt +0 -21
  142. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/prefab_config.json +0 -8
  143. package/react-native/android/.cxx/Debug/6p5m3p3q/arm64-v8a/symbol_folder_index.txt +0 -1
  144. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  145. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  146. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  147. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/reply/cache-v2-0cc74b41e95a51ba0457.json +0 -1303
  148. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/reply/cmakeFiles-v1-ee90fea936bce5771631.json +0 -203
  149. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/reply/codemodel-v2-82fa8946198e6eba430b.json +0 -60
  150. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json +0 -14
  151. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/reply/index-2023-12-06T19-58-48-0893.json +0 -92
  152. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.cmake/api/v1/reply/target-cpp-Debug-1e9d0b1a457f7fe5c618.json +0 -314
  153. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.ninja_deps +0 -0
  154. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/.ninja_log +0 -21
  155. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeCache.txt +0 -393
  156. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake +0 -79
  157. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake +0 -90
  158. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin +0 -0
  159. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin +0 -0
  160. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake +0 -115
  161. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.c +0 -803
  162. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o +0 -0
  163. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
  164. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  165. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/CMakeOutput.log +0 -304
  166. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/TargetDirectories.txt +0 -3
  167. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cmake.check_cache +0 -1
  168. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Attachment.cpp.o +0 -0
  169. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Authentication.cpp.o +0 -0
  170. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Collection.cpp.o +0 -0
  171. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/DQL.cpp.o +0 -0
  172. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Document.cpp.o +0 -0
  173. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Identity.cpp.o +0 -0
  174. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Lifecycle.cpp.o +0 -0
  175. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/LiveQuery.cpp.o +0 -0
  176. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Logger.cpp.o +0 -0
  177. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Misc.cpp.o +0 -0
  178. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Presence.cpp.o +0 -0
  179. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/RetainableState.cpp.o +0 -0
  180. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/SmallPeerInfo.cpp.o +0 -0
  181. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Transports.cpp.o +0 -0
  182. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/TypedArray.cpp.o +0 -0
  183. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Utils.cpp.o +0 -0
  184. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/main.cpp.o +0 -0
  185. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/dittoffi/ifaddrs.cpp.o +0 -0
  186. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/cpp.dir/cpp-adapter.cpp.o +0 -0
  187. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/CMakeFiles/rules.ninja +0 -64
  188. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/additional_project_files.txt +0 -0
  189. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/android_gradle_build.json +0 -42
  190. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/android_gradle_build_mini.json +0 -31
  191. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/build.ninja +0 -297
  192. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/build_file_index.txt +0 -3
  193. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/cmake_install.cmake +0 -54
  194. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/compile_commands.json +0 -97
  195. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/compile_commands.json.bin +0 -0
  196. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/configure_fingerprint.bin +0 -8755
  197. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/metadata_generation_command.txt +0 -21
  198. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/prefab_config.json +0 -8
  199. package/react-native/android/.cxx/Debug/6p5m3p3q/armeabi-v7a/symbol_folder_index.txt +0 -1
  200. package/react-native/android/.cxx/Debug/6p5m3p3q/hash_key.txt +0 -28
  201. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/arm64-v8a/prefab/lib/aarch64-linux-android/cmake/ReactAndroid/ReactAndroidConfig.cmake +0 -261
  202. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/arm64-v8a/prefab/lib/aarch64-linux-android/cmake/ReactAndroid/ReactAndroidConfigVersion.cmake +0 -9
  203. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/arm64-v8a/prefab/lib/aarch64-linux-android/cmake/fbjni/fbjniConfig.cmake +0 -9
  204. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/arm64-v8a/prefab/lib/aarch64-linux-android/cmake/fbjni/fbjniConfigVersion.cmake +0 -9
  205. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/ReactAndroid/ReactAndroidConfig.cmake +0 -261
  206. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/ReactAndroid/ReactAndroidConfigVersion.cmake +0 -9
  207. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/fbjni/fbjniConfig.cmake +0 -9
  208. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/armeabi-v7a/prefab/lib/arm-linux-androideabi/cmake/fbjni/fbjniConfigVersion.cmake +0 -9
  209. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86/prefab/lib/i686-linux-android/cmake/ReactAndroid/ReactAndroidConfig.cmake +0 -261
  210. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86/prefab/lib/i686-linux-android/cmake/ReactAndroid/ReactAndroidConfigVersion.cmake +0 -9
  211. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86/prefab/lib/i686-linux-android/cmake/fbjni/fbjniConfig.cmake +0 -9
  212. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86/prefab/lib/i686-linux-android/cmake/fbjni/fbjniConfigVersion.cmake +0 -9
  213. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86_64/prefab/lib/x86_64-linux-android/cmake/ReactAndroid/ReactAndroidConfig.cmake +0 -261
  214. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86_64/prefab/lib/x86_64-linux-android/cmake/ReactAndroid/ReactAndroidConfigVersion.cmake +0 -9
  215. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86_64/prefab/lib/x86_64-linux-android/cmake/fbjni/fbjniConfig.cmake +0 -9
  216. package/react-native/android/.cxx/Debug/6p5m3p3q/prefab/x86_64/prefab/lib/x86_64-linux-android/cmake/fbjni/fbjniConfigVersion.cmake +0 -9
  217. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  218. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  219. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  220. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/reply/cache-v2-6c4a25b4c6713ffdc5da.json +0 -1303
  221. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/reply/cmakeFiles-v1-f4200ba0f2ce507c91da.json +0 -203
  222. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/reply/codemodel-v2-9ea6ff99336eeb9a9ce9.json +0 -60
  223. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json +0 -14
  224. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/reply/index-2023-12-06T19-58-49-0301.json +0 -92
  225. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.cmake/api/v1/reply/target-cpp-Debug-a88e6d0219517e1d531b.json +0 -314
  226. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.ninja_deps +0 -0
  227. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/.ninja_log +0 -21
  228. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeCache.txt +0 -393
  229. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake +0 -79
  230. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake +0 -90
  231. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin +0 -0
  232. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin +0 -0
  233. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake +0 -113
  234. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.c +0 -803
  235. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o +0 -0
  236. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
  237. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  238. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/CMakeOutput.log +0 -322
  239. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/TargetDirectories.txt +0 -3
  240. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cmake.check_cache +0 -1
  241. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Attachment.cpp.o +0 -0
  242. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Authentication.cpp.o +0 -0
  243. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Collection.cpp.o +0 -0
  244. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/DQL.cpp.o +0 -0
  245. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Document.cpp.o +0 -0
  246. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Identity.cpp.o +0 -0
  247. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Lifecycle.cpp.o +0 -0
  248. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/LiveQuery.cpp.o +0 -0
  249. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Logger.cpp.o +0 -0
  250. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Misc.cpp.o +0 -0
  251. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Presence.cpp.o +0 -0
  252. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/RetainableState.cpp.o +0 -0
  253. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/SmallPeerInfo.cpp.o +0 -0
  254. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Transports.cpp.o +0 -0
  255. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/TypedArray.cpp.o +0 -0
  256. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Utils.cpp.o +0 -0
  257. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/main.cpp.o +0 -0
  258. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/dittoffi/ifaddrs.cpp.o +0 -0
  259. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/cpp.dir/cpp-adapter.cpp.o +0 -0
  260. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/CMakeFiles/rules.ninja +0 -64
  261. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/additional_project_files.txt +0 -0
  262. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/android_gradle_build.json +0 -42
  263. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/android_gradle_build_mini.json +0 -31
  264. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/build.ninja +0 -297
  265. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/build_file_index.txt +0 -3
  266. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/cmake_install.cmake +0 -54
  267. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/compile_commands.json +0 -97
  268. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/compile_commands.json.bin +0 -0
  269. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/metadata_generation_command.txt +0 -21
  270. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/prefab_config.json +0 -8
  271. package/react-native/android/.cxx/Debug/6p5m3p3q/x86/symbol_folder_index.txt +0 -1
  272. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/query/client-agp/cache-v2 +0 -0
  273. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/query/client-agp/cmakeFiles-v1 +0 -0
  274. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/query/client-agp/codemodel-v2 +0 -0
  275. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/reply/cache-v2-dae9c0e6f8d6c826f86e.json +0 -1303
  276. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/reply/cmakeFiles-v1-77b66408bf04fa403cf4.json +0 -203
  277. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/reply/codemodel-v2-00d5bd5dc4a882f89004.json +0 -60
  278. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/reply/directory-.-Debug-f5ebdc15457944623624.json +0 -14
  279. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/reply/index-2023-12-06T19-58-49-0701.json +0 -92
  280. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.cmake/api/v1/reply/target-cpp-Debug-ed2a7b63dedc1886a528.json +0 -314
  281. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.ninja_deps +0 -0
  282. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/.ninja_log +0 -21
  283. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeCache.txt +0 -393
  284. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CMakeCCompiler.cmake +0 -79
  285. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CMakeCXXCompiler.cmake +0 -90
  286. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_C.bin +0 -0
  287. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CMakeDetermineCompilerABI_CXX.bin +0 -0
  288. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CMakeSystem.cmake +0 -113
  289. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.c +0 -803
  290. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CompilerIdC/CMakeCCompilerId.o +0 -0
  291. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.cpp +0 -791
  292. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/3.22.1-g37088a8/CompilerIdCXX/CMakeCXXCompilerId.o +0 -0
  293. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/CMakeOutput.log +0 -322
  294. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/TargetDirectories.txt +0 -3
  295. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cmake.check_cache +0 -1
  296. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Attachment.cpp.o +0 -0
  297. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Authentication.cpp.o +0 -0
  298. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Collection.cpp.o +0 -0
  299. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/DQL.cpp.o +0 -0
  300. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Document.cpp.o +0 -0
  301. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Identity.cpp.o +0 -0
  302. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Lifecycle.cpp.o +0 -0
  303. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/LiveQuery.cpp.o +0 -0
  304. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Logger.cpp.o +0 -0
  305. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Misc.cpp.o +0 -0
  306. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Presence.cpp.o +0 -0
  307. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/RetainableState.cpp.o +0 -0
  308. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/SmallPeerInfo.cpp.o +0 -0
  309. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Transports.cpp.o +0 -0
  310. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/TypedArray.cpp.o +0 -0
  311. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/Utils.cpp.o +0 -0
  312. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/cpp/src/main.cpp.o +0 -0
  313. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/Users/teodorc/Projects/IntegrationTest/node_modules/@dittolive/ditto/react-native/dittoffi/ifaddrs.cpp.o +0 -0
  314. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/cpp.dir/cpp-adapter.cpp.o +0 -0
  315. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/CMakeFiles/rules.ninja +0 -64
  316. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/additional_project_files.txt +0 -0
  317. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/android_gradle_build.json +0 -42
  318. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/android_gradle_build_mini.json +0 -31
  319. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/build.ninja +0 -297
  320. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/build_file_index.txt +0 -3
  321. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/cmake_install.cmake +0 -54
  322. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/compile_commands.json +0 -97
  323. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/compile_commands.json.bin +0 -0
  324. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/configure_fingerprint.bin +0 -8755
  325. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/metadata_generation_command.txt +0 -21
  326. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/prefab_config.json +0 -8
  327. package/react-native/android/.cxx/Debug/6p5m3p3q/x86_64/symbol_folder_index.txt +0 -1
  328. package/react-native/android/.cxx/tools/debug/arm64-v8a/compile_commands.json +0 -97
  329. package/react-native/android/.cxx/tools/debug/armeabi-v7a/compile_commands.json +0 -97
  330. package/react-native/android/.cxx/tools/debug/x86/compile_commands.json +0 -97
  331. package/react-native/android/.cxx/tools/debug/x86_64/compile_commands.json +0 -97
  332. package/react-native/android/.gradle/8.5/checksums/checksums.lock +0 -0
  333. package/react-native/android/.gradle/8.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  334. package/react-native/android/.gradle/8.5/dependencies-accessors/gc.properties +0 -0
  335. package/react-native/android/.gradle/8.5/fileChanges/last-build.bin +0 -0
  336. package/react-native/android/.gradle/8.5/fileHashes/fileHashes.lock +0 -0
  337. package/react-native/android/.gradle/8.5/gc.properties +0 -0
  338. package/react-native/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  339. package/react-native/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  340. package/react-native/android/.gradle/vcs-1/gc.properties +0 -0
  341. package/react-native/boost/boost/assert.hpp +0 -85
  342. package/react-native/boost/boost/config/abi/borland_prefix.hpp +0 -27
  343. package/react-native/boost/boost/config/abi/borland_suffix.hpp +0 -12
  344. package/react-native/boost/boost/config/abi/msvc_prefix.hpp +0 -22
  345. package/react-native/boost/boost/config/abi/msvc_suffix.hpp +0 -8
  346. package/react-native/boost/boost/config/abi_prefix.hpp +0 -25
  347. package/react-native/boost/boost/config/abi_suffix.hpp +0 -25
  348. package/react-native/boost/boost/config/assert_cxx03.hpp +0 -211
  349. package/react-native/boost/boost/config/assert_cxx11.hpp +0 -209
  350. package/react-native/boost/boost/config/assert_cxx14.hpp +0 -47
  351. package/react-native/boost/boost/config/assert_cxx17.hpp +0 -62
  352. package/react-native/boost/boost/config/assert_cxx20.hpp +0 -59
  353. package/react-native/boost/boost/config/assert_cxx98.hpp +0 -23
  354. package/react-native/boost/boost/config/auto_link.hpp +0 -525
  355. package/react-native/boost/boost/config/compiler/borland.hpp +0 -339
  356. package/react-native/boost/boost/config/compiler/clang.hpp +0 -366
  357. package/react-native/boost/boost/config/compiler/clang_version.hpp +0 -83
  358. package/react-native/boost/boost/config/compiler/codegear.hpp +0 -385
  359. package/react-native/boost/boost/config/compiler/comeau.hpp +0 -59
  360. package/react-native/boost/boost/config/compiler/common_edg.hpp +0 -183
  361. package/react-native/boost/boost/config/compiler/compaq_cxx.hpp +0 -19
  362. package/react-native/boost/boost/config/compiler/cray.hpp +0 -446
  363. package/react-native/boost/boost/config/compiler/diab.hpp +0 -26
  364. package/react-native/boost/boost/config/compiler/digitalmars.hpp +0 -143
  365. package/react-native/boost/boost/config/compiler/gcc.hpp +0 -383
  366. package/react-native/boost/boost/config/compiler/gcc_xml.hpp +0 -114
  367. package/react-native/boost/boost/config/compiler/greenhills.hpp +0 -28
  368. package/react-native/boost/boost/config/compiler/hp_acc.hpp +0 -149
  369. package/react-native/boost/boost/config/compiler/intel.hpp +0 -577
  370. package/react-native/boost/boost/config/compiler/kai.hpp +0 -33
  371. package/react-native/boost/boost/config/compiler/metrowerks.hpp +0 -198
  372. package/react-native/boost/boost/config/compiler/mpw.hpp +0 -140
  373. package/react-native/boost/boost/config/compiler/nvcc.hpp +0 -61
  374. package/react-native/boost/boost/config/compiler/pathscale.hpp +0 -138
  375. package/react-native/boost/boost/config/compiler/pgi.hpp +0 -23
  376. package/react-native/boost/boost/config/compiler/sgi_mipspro.hpp +0 -29
  377. package/react-native/boost/boost/config/compiler/sunpro_cc.hpp +0 -222
  378. package/react-native/boost/boost/config/compiler/vacpp.hpp +0 -186
  379. package/react-native/boost/boost/config/compiler/visualc.hpp +0 -391
  380. package/react-native/boost/boost/config/compiler/xlcpp.hpp +0 -299
  381. package/react-native/boost/boost/config/compiler/xlcpp_zos.hpp +0 -173
  382. package/react-native/boost/boost/config/detail/cxx_composite.hpp +0 -203
  383. package/react-native/boost/boost/config/detail/posix_features.hpp +0 -95
  384. package/react-native/boost/boost/config/detail/select_compiler_config.hpp +0 -157
  385. package/react-native/boost/boost/config/detail/select_platform_config.hpp +0 -147
  386. package/react-native/boost/boost/config/detail/select_stdlib_config.hpp +0 -121
  387. package/react-native/boost/boost/config/detail/suffix.hpp +0 -1294
  388. package/react-native/boost/boost/config/header_deprecated.hpp +0 -26
  389. package/react-native/boost/boost/config/helper_macros.hpp +0 -37
  390. package/react-native/boost/boost/config/no_tr1/cmath.hpp +0 -28
  391. package/react-native/boost/boost/config/no_tr1/complex.hpp +0 -28
  392. package/react-native/boost/boost/config/no_tr1/functional.hpp +0 -28
  393. package/react-native/boost/boost/config/no_tr1/memory.hpp +0 -28
  394. package/react-native/boost/boost/config/no_tr1/utility.hpp +0 -28
  395. package/react-native/boost/boost/config/platform/aix.hpp +0 -33
  396. package/react-native/boost/boost/config/platform/amigaos.hpp +0 -15
  397. package/react-native/boost/boost/config/platform/beos.hpp +0 -26
  398. package/react-native/boost/boost/config/platform/bsd.hpp +0 -83
  399. package/react-native/boost/boost/config/platform/cloudabi.hpp +0 -18
  400. package/react-native/boost/boost/config/platform/cray.hpp +0 -18
  401. package/react-native/boost/boost/config/platform/cygwin.hpp +0 -71
  402. package/react-native/boost/boost/config/platform/haiku.hpp +0 -31
  403. package/react-native/boost/boost/config/platform/hpux.hpp +0 -87
  404. package/react-native/boost/boost/config/platform/irix.hpp +0 -31
  405. package/react-native/boost/boost/config/platform/linux.hpp +0 -106
  406. package/react-native/boost/boost/config/platform/macos.hpp +0 -87
  407. package/react-native/boost/boost/config/platform/qnxnto.hpp +0 -31
  408. package/react-native/boost/boost/config/platform/solaris.hpp +0 -31
  409. package/react-native/boost/boost/config/platform/symbian.hpp +0 -97
  410. package/react-native/boost/boost/config/platform/vms.hpp +0 -25
  411. package/react-native/boost/boost/config/platform/vxworks.hpp +0 -422
  412. package/react-native/boost/boost/config/platform/wasm.hpp +0 -23
  413. package/react-native/boost/boost/config/platform/win32.hpp +0 -90
  414. package/react-native/boost/boost/config/platform/zos.hpp +0 -32
  415. package/react-native/boost/boost/config/pragma_message.hpp +0 -31
  416. package/react-native/boost/boost/config/requires_threads.hpp +0 -92
  417. package/react-native/boost/boost/config/stdlib/dinkumware.hpp +0 -324
  418. package/react-native/boost/boost/config/stdlib/libcomo.hpp +0 -93
  419. package/react-native/boost/boost/config/stdlib/libcpp.hpp +0 -180
  420. package/react-native/boost/boost/config/stdlib/libstdcpp3.hpp +0 -482
  421. package/react-native/boost/boost/config/stdlib/modena.hpp +0 -79
  422. package/react-native/boost/boost/config/stdlib/msl.hpp +0 -98
  423. package/react-native/boost/boost/config/stdlib/roguewave.hpp +0 -208
  424. package/react-native/boost/boost/config/stdlib/sgi.hpp +0 -168
  425. package/react-native/boost/boost/config/stdlib/stlport.hpp +0 -258
  426. package/react-native/boost/boost/config/stdlib/vacpp.hpp +0 -74
  427. package/react-native/boost/boost/config/stdlib/xlcpp_zos.hpp +0 -61
  428. package/react-native/boost/boost/config/user.hpp +0 -133
  429. package/react-native/boost/boost/config/warning_disable.hpp +0 -47
  430. package/react-native/boost/boost/config/workaround.hpp +0 -305
  431. package/react-native/boost/boost/config.hpp +0 -67
  432. package/react-native/boost/boost/cstdint.hpp +0 -556
  433. package/react-native/boost/boost/intrusive_ptr.hpp +0 -18
  434. package/react-native/boost/boost/smart_ptr/detail/atomic_count.hpp +0 -103
  435. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc.hpp +0 -79
  436. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_atomic.hpp +0 -63
  437. package/react-native/boost/boost/smart_ptr/detail/atomic_count_gcc_x86.hpp +0 -88
  438. package/react-native/boost/boost/smart_ptr/detail/atomic_count_nt.hpp +0 -66
  439. package/react-native/boost/boost/smart_ptr/detail/atomic_count_pt.hpp +0 -104
  440. package/react-native/boost/boost/smart_ptr/detail/atomic_count_spin.hpp +0 -69
  441. package/react-native/boost/boost/smart_ptr/detail/atomic_count_std_atomic.hpp +0 -67
  442. package/react-native/boost/boost/smart_ptr/detail/atomic_count_sync.hpp +0 -72
  443. package/react-native/boost/boost/smart_ptr/detail/atomic_count_win32.hpp +0 -70
  444. package/react-native/boost/boost/smart_ptr/detail/local_counted_base.hpp +0 -148
  445. package/react-native/boost/boost/smart_ptr/detail/local_sp_deleter.hpp +0 -91
  446. package/react-native/boost/boost/smart_ptr/detail/operator_bool.hpp +0 -64
  447. package/react-native/boost/boost/smart_ptr/detail/requires_cxx11.hpp +0 -23
  448. package/react-native/boost/boost/smart_ptr/detail/shared_count.hpp +0 -707
  449. package/react-native/boost/boost/smart_ptr/detail/sp_convertible.hpp +0 -92
  450. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base.hpp +0 -92
  451. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_acc_ia64.hpp +0 -163
  452. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_aix.hpp +0 -152
  453. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_cw_ppc.hpp +0 -185
  454. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp +0 -148
  455. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ia64.hpp +0 -170
  456. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +0 -200
  457. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_ppc.hpp +0 -194
  458. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +0 -179
  459. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp +0 -186
  460. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_nt.hpp +0 -119
  461. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_pt.hpp +0 -147
  462. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_snc_ps3.hpp +0 -174
  463. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_spin.hpp +0 -141
  464. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_std_atomic.hpp +0 -147
  465. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_sync.hpp +0 -165
  466. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_vacpp_ppc.hpp +0 -163
  467. package/react-native/boost/boost/smart_ptr/detail/sp_counted_base_w32.hpp +0 -140
  468. package/react-native/boost/boost/smart_ptr/detail/sp_counted_impl.hpp +0 -309
  469. package/react-native/boost/boost/smart_ptr/detail/sp_disable_deprecated.hpp +0 -40
  470. package/react-native/boost/boost/smart_ptr/detail/sp_forward.hpp +0 -52
  471. package/react-native/boost/boost/smart_ptr/detail/sp_has_gcc_intrinsics.hpp +0 -27
  472. package/react-native/boost/boost/smart_ptr/detail/sp_has_sync_intrinsics.hpp +0 -69
  473. package/react-native/boost/boost/smart_ptr/detail/sp_interlocked.hpp +0 -173
  474. package/react-native/boost/boost/smart_ptr/detail/sp_noexcept.hpp +0 -48
  475. package/react-native/boost/boost/smart_ptr/detail/sp_nullptr_t.hpp +0 -45
  476. package/react-native/boost/boost/smart_ptr/detail/sp_obsolete.hpp +0 -32
  477. package/react-native/boost/boost/smart_ptr/detail/sp_thread_pause.hpp +0 -51
  478. package/react-native/boost/boost/smart_ptr/detail/sp_thread_sleep.hpp +0 -104
  479. package/react-native/boost/boost/smart_ptr/detail/sp_thread_yield.hpp +0 -100
  480. package/react-native/boost/boost/smart_ptr/detail/sp_typeinfo_.hpp +0 -58
  481. package/react-native/boost/boost/smart_ptr/detail/sp_win32_sleep.hpp +0 -49
  482. package/react-native/boost/boost/smart_ptr/intrusive_ptr.hpp +0 -409
  483. package/react-native/boost/boost/smart_ptr/intrusive_ref_counter.hpp +0 -188
  484. package/react-native/cpp/include/RetainableState.h +0 -24
  485. package/react-native/cpp/src/RetainableState.cpp +0 -15
  486. package/react-native/scripts/ruby/include_local_boost.rb +0 -78
@@ -2,6 +2,14 @@
2
2
  // Copyright © 2023 DittoLive Incorporated. All rights reserved.
3
3
  //
4
4
 
5
+ // NOTE: This is a temporary *hand-written* shim file for glue code for the
6
+ // Ditto native Node module. Mid to long term, we'll either move all of this
7
+ // code to the native side or generate this file via a companion CLI tool or
8
+ // something equivalent.
9
+ //
10
+ // IMPORTANT: please leave this file self-contained and do not import any
11
+ // sources from the JS SDK.
12
+
5
13
  import * as dittoCore from './@ditto.core'
6
14
  import * as Environment from './@environment'
7
15
  import { throwOnErrorResult } from './ffi-error'
@@ -162,6 +170,7 @@ export type WebAssemblyModule = RequestInfo | URL | Response | BufferSource | We
162
170
  export type AttachmentFileOperation = 'Copy' | 'Move'
163
171
 
164
172
  /** @internal */
173
+ // IDEA: rename to AttachmentHandleType for consistency.
165
174
  export type AttachmentHandle = 'AttachmentHandle_t'
166
175
 
167
176
  /** @internal */
@@ -171,7 +180,7 @@ export type RawAttachment = {
171
180
  handle: Pointer<AttachmentHandle>
172
181
  }
173
182
 
174
- // -------------------------------------- Linux & Windows Transports Hack ------
183
+ // -------------------------------------- Linux & Windows Transports ------
175
184
 
176
185
  export function dittoAddInternalBLEClientTransport(ditto: Pointer<FFIDitto>): any {
177
186
  if (Environment.isNodeBuild) {
@@ -270,6 +279,7 @@ export function documentSetCBOR(document: Pointer<FFIDocument>, path: string, cb
270
279
  trace()
271
280
  ensureInitialized()
272
281
 
282
+ // NOTE: not sure if this should be async or not.
273
283
  const pathX = bytesFromString(path)
274
284
  const errorCode = dittoCore.ditto_document_set_cbor(document, pathX, cbor)
275
285
  if (errorCode !== 0) throw new Error(errorMessage() || `ditto_document_set_cbor() failed with error code: ${errorCode}`)
@@ -647,6 +657,8 @@ export function liveQueryRegister(
647
657
  limit: number,
648
658
  offset: number,
649
659
  eventHandler: (cbParams: CBParamsDocs) => any,
660
+ // Cb may be called in parallel at any point, so let's use
661
+ // an optional error handler (which defaults to the ditto logger at 'Error' level).
650
662
  onError?: (error: any) => void,
651
663
  ): number {
652
664
  trace()
@@ -654,6 +666,10 @@ export function liveQueryRegister(
654
666
 
655
667
  const collectionNameBuffer = bytesFromString(collectionName)
656
668
  const queryBuffer = bytesFromString(query)
669
+ // Note(Daniel): the callback is now registered to be called in a detached
670
+ // manner: if the FFI / Rust does `cb()`, then when that call returns, the js
671
+ // callback itself may not have completed. This is fine, since `signalNext()`
672
+ // shall be the proper way to let the Rust core know the FFI call completed.
657
673
  const { status_code: errorCode, i64: id } = dittoCore.ditto_live_query_register_str_detached(ditto, collectionNameBuffer, queryBuffer, queryArgsCBOR, orderBy, limit, offset, wrapBackgroundCbForFFI(onError, eventHandler))
658
674
  if (errorCode !== 0) throw new Error(errorMessage() || `\`ditto_live_query_register_str()\` failed with error code: ${errorCode}`)
659
675
  return id
@@ -667,6 +683,10 @@ export function tryExperimentalRegisterChangeObserver(ditto: Pointer<FFIDitto>,
667
683
  const errorHandler = (err: any) => log('Error', `The registered store observer callback failed with ${err}`)
668
684
  const wrappedCallback = wrapBackgroundCbForFFI(errorHandler, changeHandler)
669
685
  const queryBuffer = bytesFromString(query)
686
+ // Note(Daniel): the callback is registered to be called in a detached manner:
687
+ // if the FFI / Rust does `cb()`, then when that call returns, the js callback
688
+ // itself may not have completed. This is fine, since `signalNext()` shall be
689
+ // the proper way to let the Rust core know the FFI call completed.
670
690
  const result = dittoCore.dittoffi_try_experimental_register_change_observer_str_detached(ditto, queryBuffer, queryArgsCBOR, wrappedCallback)
671
691
  throwOnErrorResult(result.error, 'dittoffi_try_experimental_register_change_observer_str_detached')
672
692
  return result.success
@@ -735,7 +755,6 @@ export async function readTransaction(ditto: Pointer<FFIDitto>): Promise<Pointer
735
755
  trace()
736
756
  ensureInitialized()
737
757
 
738
-
739
758
  const { status_code: errorCode, txn: readTransaction } = await dittoCore.ditto_read_transaction(ditto)
740
759
  if (errorCode !== 0) throw new Error(errorMessage() || `\`ditto_read_transaction()\` failed with error code: ${errorCode}`)
741
760
  return readTransaction
@@ -756,7 +775,6 @@ export async function writeTransaction(ditto: Pointer<FFIDitto>): Promise<Pointe
756
775
  trace()
757
776
  ensureInitialized()
758
777
 
759
-
760
778
  const { status_code: errorCode, txn: writeTransaction } = await dittoCore.ditto_write_transaction(ditto, null)
761
779
  if (errorCode !== 0) throw new Error(errorMessage() || `ditto_write_transaction() failed with error code: ${errorCode}`)
762
780
  return writeTransaction
@@ -832,6 +850,7 @@ export async function loggerSetCustomLogCb(cb: null | ((lvl: LogLevel, msg: stri
832
850
  if (null === cb) {
833
851
  await dittoCore.ditto_logger_set_custom_log_cb(null)
834
852
  } else {
853
+ // IDEA: pass custom error handler here instead of null?
835
854
  const wrappedCallback = wrapBackgroundCbForFFI(null, (loglevel: LogLevel, cMsg: Pointer<'char'>) => {
836
855
  try {
837
856
  const msg: string = dittoCore.boxCStringIntoString(cMsg)
@@ -1045,7 +1064,7 @@ export function uninitializedDittoMake(path: string): Pointer<FFIUninitializedDi
1045
1064
  trace()
1046
1065
  ensureInitialized()
1047
1066
  const pathX = bytesFromString(path)
1048
- return dittoCore.uninitialized_ditto_make(pathX)
1067
+ return dittoCore.ditto_uninitialized_ditto_make(pathX)
1049
1068
  }
1050
1069
 
1051
1070
  /** @internal */
@@ -1236,10 +1255,15 @@ export function dittoSetDeviceName(dittoPointer: Pointer<FFIDitto>, deviceName:
1236
1255
 
1237
1256
  if (Environment.isWebBuild) {
1238
1257
  if (deviceNameCString.length > 64) {
1239
-
1240
1258
  const sanitizedDeviceName = deviceName.replace(/[^ -~]+/g, '')
1241
1259
  deviceNameCString = bytesFromString(sanitizedDeviceName.substr(0, 63))
1242
1260
 
1261
+ // NOTE: to reproduce the issue, comment the following two in. You'll see
1262
+ // that an ASCII string of 64 characters and more will make prevent sync
1263
+ // from working.
1264
+ //
1265
+ // const demoDeviceName = "123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-4" //56789-70-456789-80-456789-90-456789" // 100
1266
+ // deviceNameCString = bytesFromString(demoDeviceName)
1243
1267
  }
1244
1268
  }
1245
1269
 
@@ -1251,7 +1275,9 @@ export function dittoSetConnectRetryInterval(dittoPointer: Pointer<FFIDitto>, re
1251
1275
  trace()
1252
1276
  ensureInitialized()
1253
1277
 
1278
+ // Unfortunately JS doesn't have a u32::MAX const...
1254
1279
  const UINT32_MAX = 4_294_967_295
1280
+ // Clamp the provided interval to u32 range (0 .. 2^32-1).
1255
1281
  const clampedInterval = Math.min(Math.max(0, retryInterval), UINT32_MAX)
1256
1282
 
1257
1283
  return dittoCore.ditto_set_connect_retry_interval(dittoPointer, clampedInterval)
@@ -1265,6 +1291,7 @@ export function dittoSetSyncGroup(dittoPointer: Pointer<FFIDitto>, syncGroup: nu
1265
1291
  return dittoCore.ditto_set_sync_group(dittoPointer, syncGroup)
1266
1292
  }
1267
1293
 
1294
+ // Not supported on Wasm.
1268
1295
  /** @internal */
1269
1296
  export function dittoNewAttachmentFromFile(ditto: Pointer<FFIDitto>, sourcePath: string, fileOperation: AttachmentFileOperation): RawAttachment {
1270
1297
  trace()
@@ -1301,6 +1328,8 @@ export async function dittoResolveAttachment(
1301
1328
  onProgress: (downloaded: number | BigInt, toDownload: number | BigInt) => void
1302
1329
  onDelete: () => void
1303
1330
  },
1331
+ // Cb may be called in parallel at any point, so let's use
1332
+ // an optional error handler (which defaults to the ditto logger at 'Error' level).
1304
1333
  onError?: (error: any) => void,
1305
1334
  ): Promise<number | BigInt> {
1306
1335
  trace()
@@ -1483,14 +1512,12 @@ export function dittoSetStaticTCPClients(ditto: Pointer<FFIDitto>, listOfServers
1483
1512
  trace()
1484
1513
  ensureInitialized()
1485
1514
 
1486
-
1487
1515
  if (Environment.isNodeBuild) {
1488
1516
  const listOfServersBytes = listOfServers.map((server) => bytesFromString(server))
1489
1517
  dittoCore.ditto_set_static_tcp_clients(ditto, listOfServersBytes)
1490
1518
  }
1491
1519
 
1492
1520
  if (Environment.isWebBuild) {
1493
-
1494
1521
  if (listOfServers.length > 0) {
1495
1522
  throw new Error(`Web variant of Ditto does not support connecting to TCP servers: ${listOfServers.join(', ')}`)
1496
1523
  }
@@ -1512,6 +1539,7 @@ export function documentsHash(documents: Pointer<FFIDocument>[]): BigInt {
1512
1539
  ensureInitialized()
1513
1540
  const { status_code: errorCode, u64: hash } = dittoCore.ditto_documents_hash(documents)
1514
1541
  if (errorCode !== 0) throw new Error(errorMessage() || `\`ditto_documents_hash()\` failed with error code: ${errorCode}`)
1542
+ // `hash` is of type `number | BigInt`, let's unify it to `BigInt` to keep it simple.
1515
1543
  return BigInt(hash)
1516
1544
  }
1517
1545
 
@@ -1569,6 +1597,8 @@ export function dittoRegisterLocalAuthServer(namedArgs: {
1569
1597
  caKeyPem?: string
1570
1598
  authCb: (authRequest: Pointer<FFIAuthServerAuthRequest>, cbor: Uint8Array) => void
1571
1599
  refreshCb: (authRequest: Pointer<FFIAuthServerRefreshRequest>, cbor: Uint8Array) => void
1600
+ // Cb may be called in parallel at any point, so let's use
1601
+ // an optional error handler
1572
1602
  onError?: (error: any) => void
1573
1603
  }): void {
1574
1604
  const { ditto, signingKeyPem, verifyingKeysPem, caKeyPem, authCb, refreshCb, onError } = namedArgs
@@ -1594,6 +1624,7 @@ export async function dittoAuthSetLoginProvider(ditto: Pointer<FFIDitto>, loginP
1594
1624
  /** @internal */
1595
1625
  export function dittoAuthClientMakeLoginProvider(
1596
1626
  expiringCb: (secs_until_expiry: number) => void,
1627
+ // Cb may be called in parallel at any point, so let's use an optional error handler
1597
1628
  onError?: (error: any) => void,
1598
1629
  ): Pointer<FFILoginProvider> {
1599
1630
  trace()
@@ -1606,6 +1637,7 @@ export function dittoAuthClientMakeLoginProvider(
1606
1637
  export function dittoAuthClientSetValidityListener(
1607
1638
  ditto: Pointer<FFIDitto>,
1608
1639
  validityUpdateCb: (isWebValid: boolean, isX509Valid: boolean) => void,
1640
+ // Cb may be called in parallel at any point, so let's use an optional error handler
1609
1641
  onError?: (error: any) => void,
1610
1642
  ): void {
1611
1643
  trace()
@@ -1836,7 +1868,7 @@ export function verifyLicense(license: string): { result: LicenseVerificationRes
1836
1868
  const licenseBuffer = bytesFromString(license)
1837
1869
  let result: LicenseVerificationResult
1838
1870
  const errorMessageCString = withOutPtr('char *', (outErrorMessage) => {
1839
- result = dittoCore.verify_license(licenseBuffer, outErrorMessage)
1871
+ result = dittoCore.ditto_verify_license(licenseBuffer, outErrorMessage)
1840
1872
  return outErrorMessage
1841
1873
  })
1842
1874
 
@@ -1849,6 +1881,7 @@ export function verifyLicense(license: string): { result: LicenseVerificationRes
1849
1881
  /** @internal */
1850
1882
  export function getDeviceName(): string | void {
1851
1883
  if (Environment.isReactNativeBuild) {
1884
+ // @ts-expect-error Throws method not-found on non-RN envs.
1852
1885
  return dittoCore.getDeviceName()
1853
1886
  }
1854
1887
  }
@@ -1856,6 +1889,7 @@ export function getDeviceName(): string | void {
1856
1889
  /** @internal */
1857
1890
  export function getRandomValues<T extends ArrayBufferView>(array: T): T | void {
1858
1891
  if (Environment.isReactNativeBuild) {
1892
+ // @ts-expect-error Throws method not-found on non-RN envs.
1859
1893
  return dittoCore.getRandomValues(array)
1860
1894
  }
1861
1895
  }
@@ -1863,6 +1897,7 @@ export function getRandomValues<T extends ArrayBufferView>(array: T): T | void {
1863
1897
  /** @internal */
1864
1898
  export function createDirectory(path: string): string | void {
1865
1899
  if (Environment.isReactNativeBuild) {
1900
+ // @ts-expect-error Throws method not-found on non-RN envs.
1866
1901
  return dittoCore.createDirectory(path)
1867
1902
  }
1868
1903
  }
@@ -1874,10 +1909,12 @@ const NOT_FOUND_ERROR_CODE = -30798
1874
1909
 
1875
1910
  /** @internal */
1876
1911
  function wrapBackgroundCbForFFI(onError: null | ((err: any) => void), cb: any): any {
1877
-
1912
+ // There's no need to wrap callbacks through JSI while they are not returning
1913
+ // anything.
1878
1914
  if (Environment.isReactNativeBuild) {
1879
1915
  return cb
1880
1916
  }
1917
+ // Basic fallback based off: https://stackoverflow.com/a/3390635
1881
1918
  if (onError === undefined) {
1882
1919
  onError = (err: any) => log('Error', `The registered callback failed with ${err}`)
1883
1920
  }
@@ -1950,16 +1987,19 @@ function errorMessage(): string {
1950
1987
  /** @internal */
1951
1988
  function trace() {
1952
1989
  if (isTracingEnabled) {
1953
-
1990
+ // Copied and adapted from a Stack Overflow comment:
1991
+ // https://stackoverflow.com/a/38435618
1954
1992
  const error = new Error()
1955
1993
  const stack = error.stack
1956
1994
  let caller = '<unknown>'
1957
1995
  try {
1958
1996
  caller = stack.split('\n')[2].trim().split(/\s+/)[1].replace('Module.', '')
1959
1997
  } catch (error) {
1998
+ // Nothing to do, caller remains unknown.
1960
1999
  }
1961
2000
 
1962
-
2001
+ // We use use `console.log()` instead of `log()` here to avoid infinite recursion.
2002
+ // eslint-disable-next-line no-console
1963
2003
  console.log(`💗 [TRACE] ${caller}()`)
1964
2004
  }
1965
2005
  }
@@ -33,7 +33,8 @@ export type InitOptions = {
33
33
  export async function init(options: InitOptions = {}): Promise<void> {
34
34
  if (!isInitialized) {
35
35
  if (Environment.isWebBuild) {
36
-
36
+ // IDEA: throw or log a warning if init() was called a second time with
37
+ // different options (because those wouldn't have any effect).
37
38
 
38
39
  const webAssemblyModule = options.webAssemblyModule || defaultDittoWasmFileURL
39
40
 
@@ -80,14 +80,11 @@ export function validateQuery(query, options = {}): string {
80
80
  *
81
81
  * @internal */
82
82
  export function generateEphemeralToken(): string {
83
- let webcrypto = undefined
84
83
 
85
84
  let data = new Uint16Array(16)
86
- if (Environment.isReactNativeBuild) {
87
- data = FFI.getRandomValues(data) as Uint16Array
88
- } else {
89
- throw new Error('Internal inconsistency, incorrect environment to run getRandomValues()')
90
- }
85
+ // Note: Replacing conditional with polymorphism. (#10731)
86
+
87
+ data = FFI.getRandomValues(data) as Uint16Array
91
88
 
92
89
  const doublets = Array.from(data)
93
90
  return doublets.map((doublet) => doublet.toString(16)).join('')
@@ -109,5 +106,4 @@ export async function step<T>(closure: () => T): Promise<T> {
109
106
  }
110
107
 
111
108
  /** @internal */
112
-
113
109
  export const performAsyncToWorkaroundNonAsyncFFIAPI = step
@@ -24,7 +24,10 @@ export class KeepAlive {
24
24
  this.countsByID[id] += 1
25
25
 
26
26
  if (this.intervalID === null) {
27
- const maxDelay = 2147483647
27
+ // Keep the process alive as long as there is at least one ID being
28
+ // tracked by setting a time interval with the maximum delay. This will
29
+ // prevent the process from exiting.
30
+ const maxDelay = 2147483647 // Signed 32 bit integer, see docs: https://developer.mozilla.org/en-US/docs/Web/API/setInterval
28
31
  this.intervalID = setInterval(() => {
29
32
  /* no-op */
30
33
  }, maxDelay)
@@ -45,7 +48,8 @@ export class KeepAlive {
45
48
  }
46
49
 
47
50
  if (Object.keys(this.countsByID).length === 0) {
48
-
51
+ // Nothing is tracked anymore, it's safe to clear the interval
52
+ // and let the process do what it wants.
49
53
  KeepAlive.finalizationRegistry.unregister(this)
50
54
  clearInterval(this.intervalID)
51
55
  this.intervalID = null
@@ -123,7 +123,10 @@ export class KeyPath {
123
123
  throw new Error(`Can't return value at given keyPath, expected keyPath to be a string or a number but got ${typeof keyPath}: ${keyPath}`)
124
124
  }
125
125
 
126
-
126
+ // NOTE: `nextPathComponentRaw` represents next path component plus all
127
+ // of its surrounding delimiters, i.e. given a path `["abc"].blah.blub`,
128
+ // `nextPathComponentRaw` would be `["abc"]` while nextPathComponent
129
+ // would just yield 'abc'.
127
130
 
128
131
  const regularKeyMatch = keyPath.match(regularKeyRegExp)
129
132
  if (regularKeyMatch !== null) {
@@ -26,9 +26,7 @@ export class LiveQueryManager {
26
26
  startLiveQuery(liveQuery: LiveQuery) {
27
27
  const ditto = this.ditto
28
28
  const dittoHandle = Bridge.ditto.handleFor(ditto)
29
-
30
-
31
-
29
+
32
30
  ditto.deferCloseAsync(async () => {
33
31
  const liveQueryID = liveQuery.liveQueryID
34
32
  if (!liveQueryID) {
@@ -48,9 +46,12 @@ export class LiveQueryManager {
48
46
  ditto.keepAlive.retain(`LiveQuery.${liveQueryID}`)
49
47
 
50
48
  return new Promise((resolve, reject) => {
51
-
49
+ // not awaited on purpose; let the invocation of the initial observation
50
+ // happen in a "fire-and-forget" / detached / escaping fashion, to be
51
+ // consistent with the subsequent invocations.
52
52
  step(async () => {
53
53
  await FFI.liveQueryStart(dittoHandle.deref(), liveQueryID)
54
+ // @ts-ignore
54
55
  resolve()
55
56
  })
56
57
  })
@@ -89,6 +89,7 @@ export class LiveQuery {
89
89
 
90
90
  /** @internal */
91
91
  constructor(query: string, queryArgs: QueryArguments | null, queryArgsCBOR: Uint8Array | null, orderBys: FFI.OrderBy[], limit: number, offset: number, collection: Collection, handler: QueryObservationHandler) {
92
+ // Query should be validated at this point.
92
93
  this.query = query
93
94
  this.queryArgs = queryArgs ? Object.freeze({ ...queryArgs }) : null
94
95
  this.queryArgsCBOR = queryArgsCBOR
@@ -148,6 +149,7 @@ export class LiveQuery {
148
149
 
149
150
  /** @internal */
150
151
  async signalNext() {
152
+ // IDEA: make this public?
151
153
  const ditto = this.collection.store.ditto
152
154
  const dittoHandle = Bridge.ditto.handleFor(ditto)
153
155
  const dittoPointer = dittoHandle.derefOrNull()
@@ -0,0 +1,60 @@
1
+ //
2
+ // Copyright © 2021 DittoLive Incorporated. All rights reserved.
3
+ //
4
+
5
+ // IMPORTANT: this file is only for exporting public API, please don't
6
+ // add "significant" logic in here (sort of a "Framework Header" in ObjC).
7
+
8
+ export * from './keep-alive'
9
+ export * from './observer'
10
+
11
+ export * from './essentials'
12
+ export * from './counter'
13
+ export * from './register'
14
+ export * from './attachment-token'
15
+
16
+ export * from './init'
17
+ export * from './logger'
18
+ export * from './document-id'
19
+
20
+ export * from './base-pending-cursor-operation'
21
+ export * from './base-pending-id-specific-operation'
22
+ export * from './authenticator'
23
+ export * from './identity'
24
+ export * from './ditto'
25
+ export * from './store-observer'
26
+ export * from './collection'
27
+ export * from './collection-interface'
28
+ export * from './collections-event'
29
+ export * from './document-path'
30
+ export * from './document'
31
+ export * from './sync'
32
+ export * from './sync-subscription'
33
+ export * from './error'
34
+ export * from './error-codes'
35
+ export * from './query-result-item'
36
+ export * from './query-result'
37
+ export * from './live-query-event'
38
+ export * from './live-query'
39
+ export * from './attachment'
40
+ export * from './attachment-fetcher'
41
+ export * from './attachment-fetch-event'
42
+ export * from './pending-cursor-operation'
43
+ export * from './pending-id-specific-operation'
44
+ export * from './pending-collections-operation'
45
+ export * from './small-peer-info'
46
+ export * from './store'
47
+ export * from './presence'
48
+ export * from './subscription'
49
+ export * from './test-helpers'
50
+ export * from './transport-config'
51
+ export * from './update-result'
52
+ export * from './update-results-map'
53
+ export * from './write-transaction'
54
+ export * from './write-transaction-collection'
55
+ export * from './write-transaction-pending-cursor-operation'
56
+ export * from './write-transaction-pending-id-specific-operation'
57
+ export * from './epilogue'
58
+
59
+ // TEMPORARY: exported to deal with non-canonical IDs.
60
+ export * from './cbor'
@@ -54,7 +54,6 @@ export class ObserverManager {
54
54
  /** @internal */
55
55
  addObserver(callback: any): ObserverToken {
56
56
  if (this.isClosed) {
57
-
58
57
  throw new Error(`Internal inconsistency, can't add '${this.id}' observer, observer mananger close()-ed.`)
59
58
  }
60
59
 
@@ -80,6 +79,9 @@ export class ObserverManager {
80
79
  return
81
80
  }
82
81
 
82
+ // The value is set to null to be able to discern between
83
+ // observers that have been removed and observers that have
84
+ // never been registered before.
83
85
  this.callbacksByToken[token] = null
84
86
 
85
87
  this.keepAlive?.release(`${this.id}.${token}`)
@@ -93,7 +95,8 @@ export class ObserverManager {
93
95
  /** @internal */
94
96
  notify(...args: any[]) {
95
97
  if (this.isClosed) {
96
-
98
+ // NOTE: we don't notify observers after closing and just swallow
99
+ // the event.
97
100
  return
98
101
  }
99
102
 
@@ -22,7 +22,9 @@ export type ObserverOptions = {
22
22
  * alive, you have to keep a reference to the corresponding observer.
23
23
  */
24
24
  export class Observer {
25
-
25
+ // NOTE: the core functionality of the observer manager is token-based. We use
26
+ // the `Observer` class merely as a public API wrapper around the token
27
+ // exposing a convenience `stop()` method plus life-cycle tracking.
26
28
 
27
29
  /** @internal */
28
30
  readonly observerManager: ObserverManaging
@@ -88,7 +88,8 @@ export class PendingIDSpecificOperation extends BasePendingIDSpecificOperation {
88
88
  const mutableDocument = Bridge.mutableDocument.bridge(documentX, () => new MutableDocument())
89
89
  closure(mutableDocument)
90
90
 
91
-
91
+ // Ownership is transferred back to the FFI layer via collectionUpdate(),
92
+ // we therefore need to explicitly unregister the instance.
92
93
  Bridge.mutableDocument.unregister(mutableDocument)
93
94
 
94
95
  const writeTransactionX = await FFI.writeTransaction(dittoHandle.deref())
@@ -194,7 +195,8 @@ export class PendingIDSpecificOperation extends BasePendingIDSpecificOperation {
194
195
  const totalNumberOfManipulations = event.isInitial === true ? 0 : event.insertions.length + event.deletions.length + event.updates.length
195
196
  if (totalNumberOfManipulations > 1) throw new Error(`Internal inconsistency, single document live query returned a combination of inserts, updates, and/or deletes, which doesn't make sense for single document observation. Query ${this.query}.`)
196
197
 
197
-
198
+ // IDEA: use `undefined` instead of `null` and
199
+ // adapt Wasm variant plus API definition.
198
200
  const document = documents[0] || null
199
201
  const oldDocument = event.isInitial === true ? undefined : event.oldDocuments[0]
200
202
 
@@ -39,7 +39,6 @@ export class PresenceManager {
39
39
  this.callbacksByPresenceToken[token] = callback
40
40
  this.ditto.keepAlive.retain(`PresenceObservation.${token}`)
41
41
 
42
-
43
42
  callback(this.currentRemotePeers)
44
43
 
45
44
  return token
@@ -125,6 +124,7 @@ export class PresenceManager {
125
124
 
126
125
  private notify() {
127
126
  if (this.isClosed) {
127
+ // NOTE: we don't notify observers after closing.
128
128
  return
129
129
  }
130
130
 
@@ -148,6 +148,7 @@ export class PresenceManager {
148
148
  }
149
149
 
150
150
  private compareRemotePeers(left: RemotePeer, right: RemotePeer) {
151
+ // NOTE: we use the exact same sort order here as in the ObjC version.
151
152
 
152
153
  if (left.connections.length === 0 && right.connections.length > 0) return +1
153
154
  if (left.connections.length > 0 && right.connections.length === 0) return -1
@@ -189,11 +189,6 @@ export class Presence {
189
189
  const observerToken = this.observerManager.addObserver(didChangeHandler)
190
190
  const observer = new Observer(this.observerManager, observerToken, { stopsWhenFinalized: true })
191
191
 
192
- // REFACTOR: make the initial callback call async, too (othewise we'd be
193
- // mixing sync with async, which is a bit problematic in general but might
194
- // be OK with single-threaded JS). This is a bit tricky, simply
195
- // setTimeout(..., 0) here could lead us to a situation where the initial
196
- // call would be sent AFTER the regular notification.
197
192
  didChangeHandler(this.graph)
198
193
 
199
194
  return observer
@@ -2,7 +2,9 @@
2
2
  // Copyright © 2022 DittoLive Incorporated. All rights reserved.
3
3
  //
4
4
 
5
-
5
+ // NOTE: we use a token to detect private invocation of the constructor. This is
6
+ // not secure and just to prevent accidental private invocation on the client
7
+ // side.
6
8
  const privateToken = '@ditto.ff82dae89821c5ab822a8b539056bce4'
7
9
 
8
10
  /**
@@ -77,7 +79,8 @@ export class MutableRegister extends Register {
77
79
 
78
80
  mutableDocument.at(path)['@ditto.set'](value)
79
81
 
80
-
82
+ // We also set the local value to make sure that the change is
83
+ // reflected locally as well as in the underlying document.
81
84
  this['@ditto.value'] = value
82
85
  }
83
86
 
@@ -132,6 +132,7 @@ export class SmallPeerInfo {
132
132
  }
133
133
  const dittoHandle = Bridge.ditto.handleFor(this.ditto)
134
134
  this.ditto.deferClose(() => {
135
+ // throws if any validation errors occur
135
136
  FFI.dittoSmallPeerInfoSetMetadata(dittoHandle.deref(), metadata)
136
137
  })
137
138
  }
@@ -171,6 +171,7 @@ export class StoreObserver {
171
171
  }
172
172
  }
173
173
 
174
+ // c.f. struct c_cb_params
174
175
  type CCallbackParams = {
175
176
  query_result: FFI.Pointer<FFI.FFIDqlResponse>
176
177
  }
@@ -72,8 +72,11 @@ export class Store {
72
72
  */
73
73
  registerObserver(query: string, observationHandler: StoreObservationHandler, queryArguments?: DQLQueryArguments): StoreObserver {
74
74
  const changeHandlerWithSignalNext: StoreObservationHandlerWithSignalNext = (queryResult: QueryResult, signalNext: () => void) => {
75
- observationHandler(queryResult)
76
- signalNext()
75
+ try {
76
+ observationHandler(queryResult)
77
+ } finally {
78
+ signalNext()
79
+ }
77
80
  }
78
81
  return this.registerObserverWithSignalNext(query, changeHandlerWithSignalNext, queryArguments)
79
82
  }
@@ -118,8 +121,15 @@ export class Store {
118
121
 
119
122
  const storeObserver = new StoreObserver(this.ditto, query, queryArguments ?? null, observationHandler)
120
123
 
124
+ // @ts-expect-error modifying readonly property
121
125
  this.observers = Object.freeze([...this.observers, storeObserver])
122
126
 
127
+ // We have two requirements for this step: (1) we want to be able to wait
128
+ // for the call to FFI to finish while closing ditto and (2) we want to
129
+ // return from this function without waiting for the call to FFI to finish.
130
+ // If we would await the call here, we could end up in a situation where
131
+ // the first callback to the event handler is emitted before we return from
132
+ // the method call that started the observer.
123
133
 
124
134
  const dittoHandle = Bridge.ditto.handleFor(this.ditto)
125
135
  this.ditto.deferCloseAsync(async () => {
@@ -131,7 +141,8 @@ export class Store {
131
141
  async () => await FFI.liveQueryStart(dittoHandle.deref(), storeObserver.liveQueryID)
132
142
  )
133
143
  } catch (error: any) {
134
-
144
+ // As this closure executes after the surrounding method has returned we don't throw
145
+ // the error here. Instead we log the error.
135
146
  Logger.error(`Failed to start live query: ${error.message}`)
136
147
  }
137
148
  resolve()
@@ -201,6 +212,8 @@ export class Store {
201
212
 
202
213
  const dittoHandle = Bridge.ditto.handleFor(this.ditto)
203
214
  return this.ditto.deferCloseAsync(async () => {
215
+ // A one-off query execution uses a transaction internally but a
216
+ // transaction API is not implemented yet.
204
217
  const writeTransaction = null
205
218
 
206
219
  let queryArgumentsCBOR: Uint8Array | null = null
@@ -214,6 +227,7 @@ export class Store {
214
227
 
215
228
  const errorContext = { query, queryArguments }
216
229
 
230
+ // prettier-ignore
217
231
  const responsePointer: FFI.Pointer<FFI.FFIDqlResponse> = await mapFFIErrorsAsync(
218
232
  async () => await performAsyncToWorkaroundNonAsyncFFIAPI(
219
233
  () => FFI.tryExperimentalExecQueryStr(dittoHandle.deref(), writeTransaction, query, queryArgumentsCBOR)
@@ -235,6 +249,7 @@ export class Store {
235
249
  * @returns a list of `WriteTransactionResult`s. There is a result for each operation performed as part of the write transaction.
236
250
  */
237
251
  async write(callback: (transaction: WriteTransaction) => Promise<void>): Promise<WriteTransactionResult[]> {
252
+ // Run caller's callback, rolling back if needed.
238
253
  return this.ditto.deferCloseAsync(async () => {
239
254
  const transaction = await WriteTransaction.init(this.ditto)
240
255
 
@@ -287,6 +302,7 @@ export class Store {
287
302
  const errorContext = { query, queryArguments }
288
303
 
289
304
  const dittoHandle = Bridge.ditto.handleFor(this.ditto)
305
+ // prettier-ignore
290
306
  return this.ditto.deferCloseAsync(async () => {
291
307
  const webhookIDCBOR = await mapFFIErrorsAsync(
292
308
  async () => await FFI.tryExperimentalWebhookRegisterDqlLiveQuery(dittoHandle.deref(), query, queryArgumentsCBOR, url),
@@ -322,6 +338,7 @@ export class Store {
322
338
  throw new DittoError('internal', "Internal inconsistency, can't remove store observer that has not been cancelled")
323
339
  }
324
340
 
341
+ // Return early if the store observer has already been removed.
325
342
  const indexToDelete = this.observers.findIndex((observer) => observer === storeObserver)
326
343
  if (indexToDelete === -1) {
327
344
  return false
@@ -329,10 +346,12 @@ export class Store {
329
346
 
330
347
  const newObservers = [...this.observers]
331
348
  newObservers.splice(indexToDelete, 1)
349
+ // @ts-expect-error modifying readonly property
332
350
  this.observers = Object.freeze(newObservers)
333
351
 
334
352
  const dittoHandle = Bridge.ditto.handleFor(this.ditto)
335
353
  this.ditto.deferClose(() => {
354
+ // prettier-ignore
336
355
  mapFFIErrors(
337
356
  () => FFI.liveQueryStop(dittoHandle.deref(), storeObserver.liveQueryID)
338
357
  )
@@ -346,7 +365,8 @@ export class Store {
346
365
  observer.cancel()
347
366
  }
348
367
 
349
-
368
+ // NOTE: live query webhook is taken care of by the FFI's
369
+ // `ditto_shutdown()`, no need to unregister it here.
350
370
  }
351
371
 
352
372
  /**