@itwin/core-backend 5.15.0-dev.9 → 5.15.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 (220) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/lib/cjs/BlobContainerService.d.ts +2 -0
  3. package/lib/cjs/BlobContainerService.d.ts.map +1 -1
  4. package/lib/cjs/BlobContainerService.js.map +1 -1
  5. package/lib/cjs/BriefcaseManager.d.ts +2 -1
  6. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  7. package/lib/cjs/BriefcaseManager.js +39 -9
  8. package/lib/cjs/BriefcaseManager.js.map +1 -1
  9. package/lib/cjs/ChangeUnifier.d.ts +82 -0
  10. package/lib/cjs/ChangeUnifier.d.ts.map +1 -0
  11. package/lib/cjs/ChangeUnifier.js +163 -0
  12. package/lib/cjs/ChangeUnifier.js.map +1 -0
  13. package/lib/cjs/ChangesetReader.d.ts +21 -2
  14. package/lib/cjs/ChangesetReader.d.ts.map +1 -1
  15. package/lib/cjs/ChangesetReader.js +37 -1
  16. package/lib/cjs/ChangesetReader.js.map +1 -1
  17. package/lib/cjs/CloudSqlite.d.ts +15 -0
  18. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  19. package/lib/cjs/CloudSqlite.js.map +1 -1
  20. package/lib/cjs/ECDb.d.ts +1 -0
  21. package/lib/cjs/ECDb.d.ts.map +1 -1
  22. package/lib/cjs/ECDb.js +4 -1
  23. package/lib/cjs/ECDb.js.map +1 -1
  24. package/lib/cjs/EditTxn.d.ts +61 -19
  25. package/lib/cjs/EditTxn.d.ts.map +1 -1
  26. package/lib/cjs/EditTxn.js +84 -29
  27. package/lib/cjs/EditTxn.js.map +1 -1
  28. package/lib/cjs/GeoCoordConfig.d.ts +1 -0
  29. package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
  30. package/lib/cjs/GeoCoordConfig.js +12 -8
  31. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  32. package/lib/cjs/IModelDb.d.ts +22 -9
  33. package/lib/cjs/IModelDb.d.ts.map +1 -1
  34. package/lib/cjs/IModelDb.js +54 -12
  35. package/lib/cjs/IModelDb.js.map +1 -1
  36. package/lib/cjs/NativeHost.d.ts.map +1 -1
  37. package/lib/cjs/NativeHost.js +5 -1
  38. package/lib/cjs/NativeHost.js.map +1 -1
  39. package/lib/cjs/Relationship.d.ts +28 -0
  40. package/lib/cjs/Relationship.d.ts.map +1 -1
  41. package/lib/cjs/Relationship.js +78 -0
  42. package/lib/cjs/Relationship.js.map +1 -1
  43. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  44. package/lib/cjs/SchemaSync.js +1 -0
  45. package/lib/cjs/SchemaSync.js.map +1 -1
  46. package/lib/cjs/TxnManager.d.ts +126 -89
  47. package/lib/cjs/TxnManager.d.ts.map +1 -1
  48. package/lib/cjs/TxnManager.js +114 -76
  49. package/lib/cjs/TxnManager.js.map +1 -1
  50. package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
  51. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  52. package/lib/cjs/ViewStore.d.ts.map +1 -1
  53. package/lib/cjs/ViewStore.js +62 -19
  54. package/lib/cjs/ViewStore.js.map +1 -1
  55. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
  56. package/lib/cjs/annotations/LeaderGeometry.js +3 -0
  57. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  58. package/lib/cjs/core-backend.d.ts +1 -0
  59. package/lib/cjs/core-backend.d.ts.map +1 -1
  60. package/lib/cjs/core-backend.js +1 -0
  61. package/lib/cjs/core-backend.js.map +1 -1
  62. package/lib/cjs/internal/BriefcaseUtils.d.ts +19 -0
  63. package/lib/cjs/internal/BriefcaseUtils.d.ts.map +1 -0
  64. package/lib/cjs/internal/BriefcaseUtils.js +65 -0
  65. package/lib/cjs/internal/BriefcaseUtils.js.map +1 -0
  66. package/lib/cjs/internal/QueryMetadataCache.d.ts +44 -0
  67. package/lib/cjs/internal/QueryMetadataCache.d.ts.map +1 -0
  68. package/lib/cjs/internal/QueryMetadataCache.js +107 -0
  69. package/lib/cjs/internal/QueryMetadataCache.js.map +1 -0
  70. package/lib/cjs/internal/Symbols.d.ts +9 -0
  71. package/lib/cjs/internal/Symbols.d.ts.map +1 -1
  72. package/lib/cjs/internal/Symbols.js +10 -1
  73. package/lib/cjs/internal/Symbols.js.map +1 -1
  74. package/lib/cjs/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  75. package/lib/cjs/internal/workspace/WorkspaceImpl.js +20 -6
  76. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  77. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +6 -6
  78. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  79. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  80. package/lib/cjs/workspace/SettingsEditor.d.ts +4 -3
  81. package/lib/cjs/workspace/SettingsEditor.d.ts.map +1 -1
  82. package/lib/cjs/workspace/SettingsEditor.js +7 -5
  83. package/lib/cjs/workspace/SettingsEditor.js.map +1 -1
  84. package/lib/esm/BlobContainerService.d.ts +2 -0
  85. package/lib/esm/BlobContainerService.d.ts.map +1 -1
  86. package/lib/esm/BlobContainerService.js.map +1 -1
  87. package/lib/esm/BriefcaseManager.d.ts +2 -1
  88. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  89. package/lib/esm/BriefcaseManager.js +40 -10
  90. package/lib/esm/BriefcaseManager.js.map +1 -1
  91. package/lib/esm/ChangeUnifier.d.ts +82 -0
  92. package/lib/esm/ChangeUnifier.d.ts.map +1 -0
  93. package/lib/esm/ChangeUnifier.js +159 -0
  94. package/lib/esm/ChangeUnifier.js.map +1 -0
  95. package/lib/esm/ChangesetReader.d.ts +21 -2
  96. package/lib/esm/ChangesetReader.d.ts.map +1 -1
  97. package/lib/esm/ChangesetReader.js +38 -2
  98. package/lib/esm/ChangesetReader.js.map +1 -1
  99. package/lib/esm/CloudSqlite.d.ts +15 -0
  100. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  101. package/lib/esm/CloudSqlite.js.map +1 -1
  102. package/lib/esm/ECDb.d.ts +1 -0
  103. package/lib/esm/ECDb.d.ts.map +1 -1
  104. package/lib/esm/ECDb.js +4 -1
  105. package/lib/esm/ECDb.js.map +1 -1
  106. package/lib/esm/EditTxn.d.ts +61 -19
  107. package/lib/esm/EditTxn.d.ts.map +1 -1
  108. package/lib/esm/EditTxn.js +85 -30
  109. package/lib/esm/EditTxn.js.map +1 -1
  110. package/lib/esm/GeoCoordConfig.d.ts +1 -0
  111. package/lib/esm/GeoCoordConfig.d.ts.map +1 -1
  112. package/lib/esm/GeoCoordConfig.js +12 -8
  113. package/lib/esm/GeoCoordConfig.js.map +1 -1
  114. package/lib/esm/IModelDb.d.ts +22 -9
  115. package/lib/esm/IModelDb.d.ts.map +1 -1
  116. package/lib/esm/IModelDb.js +56 -14
  117. package/lib/esm/IModelDb.js.map +1 -1
  118. package/lib/esm/NativeHost.d.ts.map +1 -1
  119. package/lib/esm/NativeHost.js +5 -1
  120. package/lib/esm/NativeHost.js.map +1 -1
  121. package/lib/esm/Relationship.d.ts +28 -0
  122. package/lib/esm/Relationship.d.ts.map +1 -1
  123. package/lib/esm/Relationship.js +78 -0
  124. package/lib/esm/Relationship.js.map +1 -1
  125. package/lib/esm/SchemaSync.d.ts.map +1 -1
  126. package/lib/esm/SchemaSync.js +1 -0
  127. package/lib/esm/SchemaSync.js.map +1 -1
  128. package/lib/esm/TxnManager.d.ts +126 -89
  129. package/lib/esm/TxnManager.d.ts.map +1 -1
  130. package/lib/esm/TxnManager.js +116 -78
  131. package/lib/esm/TxnManager.js.map +1 -1
  132. package/lib/esm/ViewStateHydrator.d.ts.map +1 -1
  133. package/lib/esm/ViewStateHydrator.js.map +1 -1
  134. package/lib/esm/ViewStore.d.ts.map +1 -1
  135. package/lib/esm/ViewStore.js +62 -19
  136. package/lib/esm/ViewStore.js.map +1 -1
  137. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
  138. package/lib/esm/annotations/LeaderGeometry.js +3 -0
  139. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  140. package/lib/esm/core-backend.d.ts +1 -0
  141. package/lib/esm/core-backend.d.ts.map +1 -1
  142. package/lib/esm/core-backend.js +1 -0
  143. package/lib/esm/core-backend.js.map +1 -1
  144. package/lib/esm/internal/BriefcaseUtils.d.ts +19 -0
  145. package/lib/esm/internal/BriefcaseUtils.d.ts.map +1 -0
  146. package/lib/esm/internal/BriefcaseUtils.js +61 -0
  147. package/lib/esm/internal/BriefcaseUtils.js.map +1 -0
  148. package/lib/esm/internal/QueryMetadataCache.d.ts +44 -0
  149. package/lib/esm/internal/QueryMetadataCache.d.ts.map +1 -0
  150. package/lib/esm/internal/QueryMetadataCache.js +103 -0
  151. package/lib/esm/internal/QueryMetadataCache.js.map +1 -0
  152. package/lib/esm/internal/Symbols.d.ts +9 -0
  153. package/lib/esm/internal/Symbols.d.ts.map +1 -1
  154. package/lib/esm/internal/Symbols.js +9 -0
  155. package/lib/esm/internal/Symbols.js.map +1 -1
  156. package/lib/esm/internal/workspace/WorkspaceImpl.d.ts.map +1 -1
  157. package/lib/esm/internal/workspace/WorkspaceImpl.js +20 -6
  158. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  159. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts +6 -6
  160. package/lib/esm/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  161. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  162. package/lib/esm/test/annotations/LeaderGeometry.test.js +15 -1
  163. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  164. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +144 -30
  165. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  166. package/lib/esm/test/ecdb/QueryMetadataCache.test.d.ts +2 -0
  167. package/lib/esm/test/ecdb/QueryMetadataCache.test.d.ts.map +1 -0
  168. package/lib/esm/test/ecdb/QueryMetadataCache.test.js +630 -0
  169. package/lib/esm/test/ecdb/QueryMetadataCache.test.js.map +1 -0
  170. package/lib/esm/test/element/DeleteDefinitionElements.test.js +403 -249
  171. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  172. package/lib/esm/test/element/RelationshipBatchLookup.test.d.ts +2 -0
  173. package/lib/esm/test/element/RelationshipBatchLookup.test.d.ts.map +1 -0
  174. package/lib/esm/test/element/RelationshipBatchLookup.test.js +202 -0
  175. package/lib/esm/test/element/RelationshipBatchLookup.test.js.map +1 -0
  176. package/lib/esm/test/hubaccess/BriefcaseManager.test.js +187 -1
  177. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  178. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.d.ts +2 -0
  179. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.d.ts.map +1 -0
  180. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.js +142 -0
  181. package/lib/esm/test/hubaccess/SchemaImportOrphanColumns.test.js.map +1 -0
  182. package/lib/esm/test/imodel/IModelGeolocation.test.js +8 -6
  183. package/lib/esm/test/imodel/IModelGeolocation.test.js.map +1 -1
  184. package/lib/esm/test/imodel/IModelProps.test.d.ts +2 -0
  185. package/lib/esm/test/imodel/IModelProps.test.d.ts.map +1 -0
  186. package/lib/esm/test/imodel/IModelProps.test.js +411 -0
  187. package/lib/esm/test/imodel/IModelProps.test.js.map +1 -0
  188. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.d.ts +2 -0
  189. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.d.ts.map +1 -0
  190. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.js +240 -0
  191. package/lib/esm/test/schema/SchemaViewPropertyOverrides.test.js.map +1 -0
  192. package/lib/esm/test/schema/SchemaViewValidation.test.js +2 -8
  193. package/lib/esm/test/schema/SchemaViewValidation.test.js.map +1 -1
  194. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.d.ts +2 -0
  195. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.d.ts.map +1 -0
  196. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.js +159 -0
  197. package/lib/esm/test/standalone/BriefcaseManagerDelete.test.js.map +1 -0
  198. package/lib/esm/test/standalone/ChangeUnifier.test.d.ts +2 -0
  199. package/lib/esm/test/standalone/ChangeUnifier.test.d.ts.map +1 -0
  200. package/lib/esm/test/standalone/ChangeUnifier.test.js +732 -0
  201. package/lib/esm/test/standalone/ChangeUnifier.test.js.map +1 -0
  202. package/lib/esm/test/standalone/DeleteElements.test.js +962 -83
  203. package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
  204. package/lib/esm/test/standalone/EditTxn.test.js +72 -1
  205. package/lib/esm/test/standalone/EditTxn.test.js.map +1 -1
  206. package/lib/esm/test/standalone/GeoCoordConfig.test.d.ts +2 -0
  207. package/lib/esm/test/standalone/GeoCoordConfig.test.d.ts.map +1 -0
  208. package/lib/esm/test/standalone/GeoCoordConfig.test.js +158 -0
  209. package/lib/esm/test/standalone/GeoCoordConfig.test.js.map +1 -0
  210. package/lib/esm/test/standalone/ViewStoreDb.test.js +53 -0
  211. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  212. package/lib/esm/test/workspace/SettingsContainers.test.d.ts +2 -0
  213. package/lib/esm/test/workspace/SettingsContainers.test.d.ts.map +1 -0
  214. package/lib/esm/test/workspace/SettingsContainers.test.js +95 -0
  215. package/lib/esm/test/workspace/SettingsContainers.test.js.map +1 -0
  216. package/lib/esm/workspace/SettingsEditor.d.ts +4 -3
  217. package/lib/esm/workspace/SettingsEditor.d.ts.map +1 -1
  218. package/lib/esm/workspace/SettingsEditor.js +7 -5
  219. package/lib/esm/workspace/SettingsEditor.js.map +1 -1
  220. package/package.json +18 -18
package/CHANGELOG.md CHANGED
@@ -1,6 +1,44 @@
1
1
  # Change Log - @itwin/core-backend
2
2
 
3
- This log was last generated on Mon, 12 Oct 2026 17:39:12 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 05 Nov 2026 17:47:36 GMT and should not be manually modified.
4
+
5
+ ## 5.15.0
6
+ Thu, 05 Nov 2026 17:47:36 GMT
7
+
8
+ ### Updates
9
+
10
+ - Return element/model props with Persisted<T> to convey that it has a valid id
11
+ - `EditTxn.deleteElements` is now all-or-nothing: if any element in the expanded delete set is still referenced from outside the set, nothing is deleted and the status is `ConstraintViolation`. `BulkDeleteElementsStatus.PartialSuccess` has been removed. `BulkDeleteElementsResult.failures` reports each blocking element with a `BulkDeleteFailureReason`. Deprecated `skipFKConstraintValidations` (now ignored) and `failedIds`. Successful deletes invalidate instance caches, including surviving elements whose navigation references were cleared.
12
+ - Text annotation fields can index into a String property holding serialized JSON.
13
+ - Quantity and coordinate `FieldRun` values in text annotations now render through the iTwin.js quantity formatting pipeline instead of `toString()`, using the property's KindOfQuantity and the schema's presentation format by default. Apps can supply `FormatSet`s per iModel with `ElementDrivesTextAnnotation.registerFieldFormatting` and evaluate fields in memory with `ElementDrivesTextAnnotation.evaluateFields`. `@itwin/core-quantity` is now a peer dependency of this package.
14
+ - ViewStore.queryViews now validates its query parameters and binds them as SQL parameters.
15
+ - Preserve unchanged geographic coordinate systems during iModel property updates, safely restore the cached CRS after rollback without reentrant writes or stranded transactions when listeners throw, preserve original scoped edit errors even when rollback logging fails, and retry default GCS workspace loading after failed initial connections.
16
+ - Add @beta ChangeUnifier, which merges the rows of ChangesetReaders into EC instances in native code with bounded memory.
17
+ - Add optional iModelId to BlobContainer.MetadataResponse.
18
+ - Added TxnManager.onPrePushValidation.
19
+ - NativeApp.deleteBriefcase now only deletes files in the briefcase cache or valid iModels. BriefcaseManager.deleteBriefcaseFiles only deletes associated files named '<briefcase>-*' or '<briefcase>.*'.
20
+ - Reuse ECSQL column metadata for cached statements in withQueryReader.
21
+ - Promote RebaseManager abort, resume, dispose, rebase events, setCustomHandler, merge state, and RebaseHandler (including recompute, dispose, and shouldReinstate) from @alpha to @beta. Promote TxnManager.rebaser from @internal to @beta. Promote TxnManager.withIndirectTxnMode, withIndirectTxnModeAsync, getMode, getTxnProps, queryTxns, getLastSavedTxnProps, and TxnMode from @alpha to @beta. Mark RebaseManager.resumeSemantic, onConflict, addConflictHandler, and removeConflictHandler as @internal because they depend on internal types.
22
+ - Add Relationships.queryInstances and queryInstancesProps to look up many relationships of a class with batched queries.
23
+ - Bug fix for leader fill color
24
+ - Added check against 0 length elbow when wantElbow is true
25
+ - Move Sheet and Drawing sub-model class validation into Element.onSubModelInsert and allow domain ISubModeledElement classes to define permitted model classes.
26
+ - Add a beta API for discovering available Vertical Coordinate Reference Systems.
27
+
28
+ ## 5.14.6
29
+ Wed, 04 Nov 2026 17:35:14 GMT
30
+
31
+ _Version update only_
32
+
33
+ ## 5.14.5
34
+ Tue, 27 Oct 2026 12:19:48 GMT
35
+
36
+ _Version update only_
37
+
38
+ ## 5.14.4
39
+ Fri, 23 Oct 2026 19:58:24 GMT
40
+
41
+ _Version update only_
4
42
 
5
43
  ## 5.14.3
6
44
  Mon, 12 Oct 2026 17:37:54 GMT
@@ -60,6 +60,8 @@ export declare namespace BlobContainer {
60
60
  containerId: string;
61
61
  /** The iTwinId that owns this container. */
62
62
  iTwinId?: GuidString;
63
+ /** The iModelId that owns this container. */
64
+ iModelId?: GuidString;
63
65
  /** The account iTwinId of the owning iTwin. */
64
66
  accountITwinId?: GuidString;
65
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BlobContainerService.d.ts","sourceRoot":"","sources":["../../src/BlobContainerService.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;;GAGG;AACH,yBAAiB,aAAa,CAAC;IAE7B,+FAA+F;IACxF,IAAI,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EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAElE;;;;WAIG;QACH,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAEtG,mDAAmD;QACnD,UAAU,CAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAEpF,qEAAqE;QACrE,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;KAC7D;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"BlobContainerService.js","sourceRoot":"","sources":["../../src/BlobContainerService.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAiB,aAAa,CAsL7B;AAtLD,WAAiB,aAAa;AAsL9B,CAAC,EAtLgB,aAAa,6BAAb,aAAa,QAsL7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BlobContainers\r\n */\r\n\r\n// spell:ignore datacenter\r\n\r\nimport { AccessToken, GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { SettingsContainer } from \"./workspace/Settings\";\r\n\r\n/**\r\n * Types and functions for creating, deleting and authorizing access to cloud-based blob containers for an iTwin.\r\n * @beta\r\n */\r\nexport namespace BlobContainer {\r\n\r\n /** Object that implements the methods to create, delete, and request access to a container. */\r\n export let service: BlobContainer.ContainerService | undefined;\r\n\r\n /** name of cloud provider for a container. */\r\n export type Provider = \"azure\" | \"google\";\r\n\r\n /** the name of the container within its `Scope` */\r\n export type ContainerId = string;\r\n\r\n /** token that authenticates a user. This token is required to obtain a `ContainerToken`. */\r\n export type UserToken = AccessToken;\r\n\r\n /** token that authenticates access to a container for either read or write. */\r\n export type ContainerToken = AccessToken;\r\n\r\n /**\r\n * The scope for a container. This determines:\r\n * - the \"owner\" organization, including the contract that governs its legal and commercial terms and obligations\r\n * - the administrators who may configure RBAC permissions\r\n * - the datacenter for the container. Every container resides in a datacenter as determined by the iTwinId. This\r\n * determines the region for data residency requirements.\r\n * - the lifecycle constraints for the container. No container can outlive its iTwin or its iModel (if defined). That is,\r\n * when the iTwin/iModel is deleted (either explicitly or due to contract expiration), the container is also deleted.\r\n */\r\n export interface Scope {\r\n /** iTwinId of the owner of this container. */\r\n iTwinId: Id64String;\r\n /** optionally, an iModelId within the iTwin. If present, container is deleted when the iModel is deleted. */\r\n iModelId?: Id64String;\r\n /** the user GUID an individual, if this container is private. */\r\n ownerGuid?: GuidString;\r\n }\r\n\r\n /**\r\n * Metadata about the use of a container so that:\r\n * - administrators can understand why a container exists for assigning RBAC permissions appropriately\r\n * - usage reports can aggregate types of containers\r\n * - applications can identify their containers\r\n * - applications can store properties about their containers\r\n */\r\n export interface Metadata {\r\n /** The machine-readable string that describes what the container is being used for (e.g. \"workspace\"). Always lowercase and singular. */\r\n containerType: string;\r\n /** Human-readable name for the container. This will be displayed in the administrator RBAC panel, and on usage reports. Not required to be unique.*/\r\n label: string;\r\n /** Optional human-readable explanation of the information held in the container. This will be displayed in the administrator RBAC panel, and on usage reports. */\r\n description?: string;\r\n /** optional properties for the container */\r\n json?: SettingsContainer;\r\n }\r\n\r\n /**\r\n * Properties returned by queryContainersMetadata\r\n */\r\n export interface MetadataResponse extends Metadata {\r\n /** The id of the container. */\r\n containerId: string;\r\n /** The iTwinId that owns this container. */\r\n iTwinId?: GuidString;\r\n /** The account iTwinId of the owning iTwin. */\r\n accountITwinId?: GuidString;\r\n }\r\n\r\n /** Properties returned by `Service.requestToken` */\r\n export interface TokenProps {\r\n /**\r\n * Expiring token that provides the requested access to the container. Should be used in all subsequent requests for blobs within the container,\r\n * and must be refreshed before it expires\r\n */\r\n token: ContainerToken;\r\n /** Scope of the container. */\r\n scope: Scope;\r\n /** Name of the blob storage provider. */\r\n provider: Provider;\r\n /** Time at which the token will expire. The token should be refreshed (that is, a new token should be requested) before this time. */\r\n expiration: Date;\r\n /** Metadata of the container. */\r\n metadata: Metadata;\r\n /** Base URI of the storage account that hosts the container */\r\n baseUri: string;\r\n }\r\n\r\n /** The URI and Id of the container. */\r\n export interface UriAndId {\r\n baseUri: string;\r\n containerId: ContainerId;\r\n }\r\n\r\n /** Information required to access an existing container. */\r\n export interface AccessContainerProps extends UriAndId {\r\n userToken: UserToken;\r\n }\r\n\r\n /** Information about a newly created container. */\r\n export interface CreatedContainerProps extends UriAndId {\r\n /** name of the blob storage provider. */\r\n provider: Provider;\r\n }\r\n\r\n /**\r\n * Access level to request for token.\r\n * - `\"write\"`: request a writeable AccessToken.\r\n * - `\"read\"`: request a read-only AccessToken.\r\n * - `\"admin\"`: request a admin AccessToken.\r\n * - `\"writeIfPossible\"`: first request a writeable AccessToken. If the user is not authorized for write, request a read-only AccessToken.\r\n * If the user is not authorized for the level requested, an exception is thrown.\r\n */\r\n export type RequestAccessLevel = \"write\" | \"read\" | \"admin\" | \"writeIfPossible\";\r\n\r\n /** Information required to request an access token for a container. */\r\n export interface RequestTokenProps extends Omit<AccessContainerProps, \"baseUri\"> {\r\n /** the level of access requested. If not specified, defaults to `\"writeIfPossible\"`. */\r\n accessLevel?: RequestAccessLevel;\r\n /** the number of seconds before the token should expire.\r\n * @note A maximum duration is determined by the service. If no value is supplied, or the value is larger than the maximum, the maximum duration is used.\r\n */\r\n durationSeconds?: number;\r\n }\r\n\r\n /** Information required to create a new container. */\r\n export interface CreateNewContainerProps {\r\n /** the scope of the new container */\r\n scope: Scope;\r\n /** metadata to be stored on the new container */\r\n metadata: Metadata;\r\n /** The user's access token. The user must be authorized with \"create container\" RBAC role for the iTwin. */\r\n userToken: UserToken;\r\n /**\r\n * the id for the container. Useful for tests.\r\n * @internal\r\n */\r\n containerId?: ContainerId;\r\n }\r\n\r\n /**\r\n * Query Parameters for querying containers\r\n */\r\n export interface QueryContainerProps {\r\n /** the iTwinId of the containers to query */\r\n iTwinId: GuidString;\r\n /** optional iModelId of the containers to query */\r\n iModelId?: GuidString;\r\n /** optional containerType of the containers to query */\r\n containerType?: GuidString;\r\n /** optional label of the containers to query */\r\n label?: GuidString;\r\n /** Whether to include parent iTwins in the query. Pass `true` to traverse the full parent chain, or `{ filter: \"accountOnly\" }` to include only the account iTwin. Defaults to `false`. */\r\n includeParentITwins?: boolean | { filter: \"accountOnly\" };\r\n }\r\n\r\n /** Methods to create, delete, and access blob containers. */\r\n export interface ContainerService {\r\n /** Create a new blob container. Throws on failure (e.g. access denied or container already exists.) */\r\n create(props: CreateNewContainerProps): Promise<CreatedContainerProps>;\r\n\r\n /**\r\n * Delete an existing blob container.\r\n * @note This method requires that the user be authorized with \"delete container\" RBAC role for the iTwin.\r\n */\r\n delete(container: AccessContainerProps): Promise<void>;\r\n\r\n /** query the Scope for a container */\r\n queryScope(container: AccessContainerProps): Promise<Scope>;\r\n\r\n /** query the Metadata for a specific container */\r\n queryMetadata(container: AccessContainerProps): Promise<Metadata>;\r\n\r\n /** Returns all containers and their metadata associated with a given iTwinId.\r\n * Pass `includeParentITwins: { filter: \"accountOnly\" }` to also include the account iTwin container,\r\n * without traversing any higher parent chain.\r\n * Results can be further queried by label and containerType.\r\n */\r\n queryContainersMetadata(userToken: UserToken, args: QueryContainerProps): Promise<MetadataResponse[]>;\r\n\r\n /** update the json properties of this container */\r\n updateJson(container: AccessContainerProps, json: SettingsContainer): Promise<void>;\r\n\r\n /** Request a `ContainerToken` for a container. Throws on failure. */\r\n requestToken(props: RequestTokenProps): Promise<TokenProps>;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BlobContainerService.js","sourceRoot":"","sources":["../../src/BlobContainerService.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAOH;;;GAGG;AACH,IAAiB,aAAa,CAwL7B;AAxLD,WAAiB,aAAa;AAwL9B,CAAC,EAxLgB,aAAa,6BAAb,aAAa,QAwL7B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module BlobContainers\r\n */\r\n\r\n// spell:ignore datacenter\r\n\r\nimport { AccessToken, GuidString, Id64String } from \"@itwin/core-bentley\";\r\nimport { SettingsContainer } from \"./workspace/Settings\";\r\n\r\n/**\r\n * Types and functions for creating, deleting and authorizing access to cloud-based blob containers for an iTwin.\r\n * @beta\r\n */\r\nexport namespace BlobContainer {\r\n\r\n /** Object that implements the methods to create, delete, and request access to a container. */\r\n export let service: BlobContainer.ContainerService | undefined;\r\n\r\n /** name of cloud provider for a container. */\r\n export type Provider = \"azure\" | \"google\";\r\n\r\n /** the name of the container within its `Scope` */\r\n export type ContainerId = string;\r\n\r\n /** token that authenticates a user. This token is required to obtain a `ContainerToken`. */\r\n export type UserToken = AccessToken;\r\n\r\n /** token that authenticates access to a container for either read or write. */\r\n export type ContainerToken = AccessToken;\r\n\r\n /**\r\n * The scope for a container. This determines:\r\n * - the \"owner\" organization, including the contract that governs its legal and commercial terms and obligations\r\n * - the administrators who may configure RBAC permissions\r\n * - the datacenter for the container. Every container resides in a datacenter as determined by the iTwinId. This\r\n * determines the region for data residency requirements.\r\n * - the lifecycle constraints for the container. No container can outlive its iTwin or its iModel (if defined). That is,\r\n * when the iTwin/iModel is deleted (either explicitly or due to contract expiration), the container is also deleted.\r\n */\r\n export interface Scope {\r\n /** iTwinId of the owner of this container. */\r\n iTwinId: Id64String;\r\n /** optionally, an iModelId within the iTwin. If present, container is deleted when the iModel is deleted. */\r\n iModelId?: Id64String;\r\n /** the user GUID an individual, if this container is private. */\r\n ownerGuid?: GuidString;\r\n }\r\n\r\n /**\r\n * Metadata about the use of a container so that:\r\n * - administrators can understand why a container exists for assigning RBAC permissions appropriately\r\n * - usage reports can aggregate types of containers\r\n * - applications can identify their containers\r\n * - applications can store properties about their containers\r\n */\r\n export interface Metadata {\r\n /** The machine-readable string that describes what the container is being used for (e.g. \"workspace\"). Always lowercase and singular. */\r\n containerType: string;\r\n /** Human-readable name for the container. This will be displayed in the administrator RBAC panel, and on usage reports. Not required to be unique.*/\r\n label: string;\r\n /** Optional human-readable explanation of the information held in the container. This will be displayed in the administrator RBAC panel, and on usage reports. */\r\n description?: string;\r\n /** optional properties for the container */\r\n json?: SettingsContainer;\r\n }\r\n\r\n /**\r\n * Properties returned by queryContainersMetadata\r\n */\r\n export interface MetadataResponse extends Metadata {\r\n /** The id of the container. */\r\n containerId: string;\r\n /** The iTwinId that owns this container. */\r\n iTwinId?: GuidString;\r\n /** The iModelId that owns this container. */\r\n iModelId?: GuidString;\r\n /** The account iTwinId of the owning iTwin. */\r\n accountITwinId?: GuidString;\r\n }\r\n\r\n /** Properties returned by `Service.requestToken` */\r\n export interface TokenProps {\r\n /**\r\n * Expiring token that provides the requested access to the container. Should be used in all subsequent requests for blobs within the container,\r\n * and must be refreshed before it expires\r\n */\r\n token: ContainerToken;\r\n /** Scope of the container. */\r\n scope: Scope;\r\n /** Name of the blob storage provider. */\r\n provider: Provider;\r\n /** Time at which the token will expire. The token should be refreshed (that is, a new token should be requested) before this time. */\r\n expiration: Date;\r\n /** Metadata of the container. */\r\n metadata: Metadata;\r\n /** Base URI of the storage account that hosts the container */\r\n baseUri: string;\r\n }\r\n\r\n /** The URI and Id of the container. */\r\n export interface UriAndId {\r\n baseUri: string;\r\n containerId: ContainerId;\r\n }\r\n\r\n /** Information required to access an existing container. */\r\n export interface AccessContainerProps extends UriAndId {\r\n userToken: UserToken;\r\n }\r\n\r\n /** Information about a newly created container. */\r\n export interface CreatedContainerProps extends UriAndId {\r\n /** name of the blob storage provider. */\r\n provider: Provider;\r\n }\r\n\r\n /**\r\n * Access level to request for token.\r\n * - `\"write\"`: request a writeable AccessToken.\r\n * - `\"read\"`: request a read-only AccessToken.\r\n * - `\"admin\"`: request a admin AccessToken.\r\n * - `\"writeIfPossible\"`: first request a writeable AccessToken. If the user is not authorized for write, request a read-only AccessToken.\r\n * If the user is not authorized for the level requested, an exception is thrown.\r\n */\r\n export type RequestAccessLevel = \"write\" | \"read\" | \"admin\" | \"writeIfPossible\";\r\n\r\n /** Information required to request an access token for a container. */\r\n export interface RequestTokenProps extends Omit<AccessContainerProps, \"baseUri\"> {\r\n /** the level of access requested. If not specified, defaults to `\"writeIfPossible\"`. */\r\n accessLevel?: RequestAccessLevel;\r\n /** the number of seconds before the token should expire.\r\n * @note A maximum duration is determined by the service. If no value is supplied, or the value is larger than the maximum, the maximum duration is used.\r\n */\r\n durationSeconds?: number;\r\n }\r\n\r\n /** Information required to create a new container. */\r\n export interface CreateNewContainerProps {\r\n /** the scope of the new container */\r\n scope: Scope;\r\n /** metadata to be stored on the new container */\r\n metadata: Metadata;\r\n /** The user's access token. The user must be authorized with \"create container\" RBAC role for the iTwin. */\r\n userToken: UserToken;\r\n /**\r\n * the id for the container. Useful for tests.\r\n * @internal\r\n */\r\n containerId?: ContainerId;\r\n }\r\n\r\n /**\r\n * Query Parameters for querying containers\r\n */\r\n export interface QueryContainerProps {\r\n /** the iTwinId of the containers to query */\r\n iTwinId: GuidString;\r\n /** optional iModelId of the containers to query */\r\n iModelId?: GuidString;\r\n /** optional containerType of the containers to query */\r\n containerType?: GuidString;\r\n /** optional label of the containers to query */\r\n label?: GuidString;\r\n /** Whether to include parent iTwins in the query. Pass `true` to traverse the full parent chain, or `{ filter: \"accountOnly\" }` to include only the account iTwin. Defaults to `false`. */\r\n includeParentITwins?: boolean | { filter: \"accountOnly\" };\r\n }\r\n\r\n /** Methods to create, delete, and access blob containers. */\r\n export interface ContainerService {\r\n /** Create a new blob container. Throws on failure (e.g. access denied or container already exists.) */\r\n create(props: CreateNewContainerProps): Promise<CreatedContainerProps>;\r\n\r\n /**\r\n * Delete an existing blob container.\r\n * @note This method requires that the user be authorized with \"delete container\" RBAC role for the iTwin.\r\n */\r\n delete(container: AccessContainerProps): Promise<void>;\r\n\r\n /** query the Scope for a container */\r\n queryScope(container: AccessContainerProps): Promise<Scope>;\r\n\r\n /** query the Metadata for a specific container */\r\n queryMetadata(container: AccessContainerProps): Promise<Metadata>;\r\n\r\n /** Returns all containers and their metadata associated with a given iTwinId.\r\n * Pass `includeParentITwins: { filter: \"accountOnly\" }` to also include the account iTwin container,\r\n * without traversing any higher parent chain.\r\n * Results can be further queried by label and containerType.\r\n */\r\n queryContainersMetadata(userToken: UserToken, args: QueryContainerProps): Promise<MetadataResponse[]>;\r\n\r\n /** update the json properties of this container */\r\n updateJson(container: AccessContainerProps, json: SettingsContainer): Promise<void>;\r\n\r\n /** Request a `ContainerToken` for a container. Throws on failure. */\r\n requestToken(props: RequestTokenProps): Promise<TokenProps>;\r\n }\r\n}\r\n"]}
@@ -179,7 +179,8 @@ export declare class BriefcaseManager {
179
179
  /**
180
180
  * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.
181
181
  * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and
182
- * associated files (that is, all files in the same directory that start with the briefcase name).
182
+ * associated files (that is, files in the same directory named `<briefcase file name>-*` or `<briefcase file name>.*`,
183
+ * e.g. "a.bim-wal", "a.bim-locks", "a.bim.Tiles").
183
184
  * @param filePath the full file name of the Briefcase to delete
184
185
  * @param accessToken for releasing the briefcaseId
185
186
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BriefcaseManager.d.ts","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EACL,WAAW,EAAE,UAAU,EAA6B,UAAU,EAAmD,QAAQ,EAC1H,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,WAAW,EAAoB,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,kB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,GAAG,IAAI;IAwB3I;;;;;;OAMG;WACW,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAMxE;;;;;;OAMG;WACkB,6BAA6B,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC,aAAa,CAAC;IAWjH;;;;;;OAMG;WACW,gCAAgC,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAMvF;;;;;;OAMG;WACW,8BAA8B,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAMrF;;;;;OAKG;WACW,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAazE;;;;;MAKE;WACY,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAavE;;;;;OAKG;WACW,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,GAAE,OAAe,GAAG,IAAI;IAiBvF;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAapC"}
@@ -21,6 +21,7 @@ const IModelJsFs_1 = require("./IModelJsFs");
21
21
  const SchemaSync_1 = require("./SchemaSync");
22
22
  const Symbols_1 = require("./internal/Symbols");
23
23
  const NativePlatform_1 = require("./internal/NativePlatform");
24
+ const BriefcaseUtils_1 = require("./internal/BriefcaseUtils");
24
25
  const StashManager_1 = require("./StashManager");
25
26
  const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.IModelDb;
26
27
  /** Manages downloading Briefcases and downloading and uploading changesets.
@@ -220,27 +221,41 @@ class BriefcaseManager {
220
221
  /**
221
222
  * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.
222
223
  * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and
223
- * associated files (that is, all files in the same directory that start with the briefcase name).
224
+ * associated files (that is, files in the same directory named `<briefcase file name>-*` or `<briefcase file name>.*`,
225
+ * e.g. "a.bim-wal", "a.bim-locks", "a.bim.Tiles").
224
226
  * @param filePath the full file name of the Briefcase to delete
225
227
  * @param accessToken for releasing the briefcaseId
226
228
  */
227
229
  static async deleteBriefcaseFiles(filePath, accessToken) {
230
+ let briefcase;
228
231
  try {
229
232
  const db = IModelDb_1.IModelDb.openDgnDb({ path: filePath }, core_bentley_1.OpenMode.Readonly);
230
- const briefcase = {
233
+ briefcase = {
231
234
  iModelId: db.getIModelId(),
232
235
  briefcaseId: db.getBriefcaseId(),
233
236
  };
234
237
  db.closeFile();
235
- if (this.isValidBriefcaseId(briefcase.briefcaseId))
236
- this.cleanupRebaseFolders(filePath, briefcase.briefcaseId); // cleanup rebase folders
238
+ }
239
+ catch {
240
+ // not a valid iModel (e.g. missing, corrupt, or partially downloaded). Just delete the files below.
241
+ }
242
+ // Clean up the rebase folders and release the briefcaseId independently, so a failure in one doesn't prevent the other.
243
+ if (undefined !== briefcase && this.isValidBriefcaseId(briefcase.briefcaseId)) {
244
+ try {
245
+ this.cleanupRebaseFolders(filePath, briefcase.briefcaseId);
246
+ }
247
+ catch (err) {
248
+ core_bentley_1.Logger.logWarning(loggerCategory, `Failed to clean up rebase folders for ${filePath}: ${String(err)}`);
249
+ }
237
250
  if (accessToken) {
238
- if (this.isValidBriefcaseId(briefcase.briefcaseId)) {
251
+ try {
239
252
  await BriefcaseManager.releaseBriefcase(accessToken, briefcase);
240
253
  }
254
+ catch (err) {
255
+ core_bentley_1.Logger.logWarning(loggerCategory, `Failed to release briefcaseId ${briefcase.briefcaseId} for ${filePath}: ${String(err)}`);
256
+ }
241
257
  }
242
258
  }
243
- catch { }
244
259
  // first try to delete the briefcase file
245
260
  try {
246
261
  if (IModelJsFs_1.IModelJsFs.existsSync(filePath))
@@ -249,14 +264,15 @@ class BriefcaseManager {
249
264
  catch (err) {
250
265
  throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `cannot delete briefcase file ${String(err)}`);
251
266
  }
252
- // next, delete all files that start with the briefcase's filePath (e.g. "a.bim-locks", "a.bim-journal", etc.)
267
+ // next, delete the briefcase's associated files (e.g. "a.bim-wal", "a.bim-locks", "a.bim.Tiles", etc.)
253
268
  try {
254
269
  const dirName = path.dirname(filePath);
255
270
  const fileName = path.basename(filePath);
256
271
  const files = IModelJsFs_1.IModelJsFs.readdirSync(dirName);
257
272
  for (const file of files) {
258
- if (file.startsWith(fileName))
259
- this.deleteFile(path.join(dirName, file)); // don't throw on error
273
+ const sidecar = path.join(dirName, file);
274
+ if ((0, BriefcaseUtils_1.isBriefcaseSidecar)(file, fileName) && !IModelJsFs_1.IModelJsFs.lstatSync(sidecar)?.isDirectory)
275
+ this.deleteFile(sidecar); // don't throw on error
260
276
  }
261
277
  }
262
278
  catch { }
@@ -539,6 +555,10 @@ class BriefcaseManager {
539
555
  core_bentley_1.Logger.logInfo(loggerCategory, `Dropping restore point ${this.PULL_MERGE_RESTORE_POINT_NAME}`);
540
556
  this.dropRestorePoint(briefcaseDb, this.PULL_MERGE_RESTORE_POINT_NAME);
541
557
  }
558
+ // Local schema txns were reversed and reinstated without a full clear (semantic rebase clears per schema txn,
559
+ // but the regular rebase does not), so caches filled during the merge may describe the schema without them.
560
+ if (hasLocalSchemaTxn)
561
+ db.clearCaches();
542
562
  }
543
563
  // notify listeners
544
564
  db.notifyChangesetApplied();
@@ -631,6 +651,14 @@ class BriefcaseManager {
631
651
  if (db.txns.isIndirectChanges) {
632
652
  throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "Cannot push changeset while in an indirect change scope");
633
653
  }
654
+ await db.txns.onPrePushValidation.raiseEvent();
655
+ // A listener may have pushed the pending changes itself (e.g. by calling pushChanges), leaving nothing to push.
656
+ // We shouldn't error in this case.
657
+ if (!db[Symbols_1._nativeDb].hasPendingTxns()) {
658
+ if (!arg.retainLocks)
659
+ await db.locks[Symbols_1._releaseAllLocks]();
660
+ return;
661
+ }
634
662
  const changesetProps = db[Symbols_1._nativeDb].startCreateChangeset();
635
663
  changesetProps.briefcaseId = db.briefcaseId;
636
664
  changesetProps.description = arg.description;
@@ -684,6 +712,8 @@ class BriefcaseManager {
684
712
  try {
685
713
  await BriefcaseManager.pullAndApplyChangesets(db, { ...arg, onProgress: arg.onDownloadProgress });
686
714
  SchemaSync_1.SchemaSync.updateDbSchema(db);
715
+ // Refresh the iModel properties in case the pull changed them.
716
+ db[Symbols_1._refreshIModelProps]();
687
717
  // pullAndApply rebase changes and might remove redundant changes in local briefcase
688
718
  // this mean hasPendingTxns was true before but now after pullAndApply it might be false
689
719
  if (!db[Symbols_1._nativeDb].hasPendingTxns()) {