Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix containerType being overwritten with "property-store" (backport #7374) [release/4.10.x] #7393

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-backend",
"comment": "Fix CloudSqlite.DbAccess.createBlobContainer always overwriting containerType with \"property-store\".",
"type": "none"
}
],
"packageName": "@itwin/core-backend"
}
2 changes: 1 addition & 1 deletion core/backend/src/CloudSqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ export namespace CloudSqlite {
throw new Error("no authorization client available");

const userToken = await auth.getAccessToken();
const cloudContainer = await service.create({ scope: args.scope, metadata: { ...args.metadata, containerType: "property-store" }, userToken });
const cloudContainer = await service.create({ scope: args.scope, metadata: args.metadata, userToken });
return { baseUri: cloudContainer.baseUri, containerId: cloudContainer.containerId, storageType: cloudContainer.provider };
}

Expand Down
10 changes: 10 additions & 0 deletions example-code/snippets/src/backend/WorkspaceExamples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { expect } from "chai";
import { IModelTestUtils } from "./IModelTestUtils";
import {
BlobContainer,
EditableWorkspaceContainer, EditableWorkspaceDb, IModelHost, SettingGroupSchema, SettingsContainer,
SettingsDictionaryProps, SettingsPriority, StandaloneDb, Workspace, WorkspaceDb, WorkspaceEditor,
} from "@itwin/core-backend";
Expand Down Expand Up @@ -323,6 +324,15 @@ describe("Workspace Examples", () => {
expect(cornusDb.cloudProps).not.to.be.undefined;
expect(cornusDb.cloudProps!.version).to.equal("1.0.0");

const svc = BlobContainer.service!;
expect(svc).not.to.be.undefined;
const metadata = await svc.queryMetadata({
baseUri: cornusDb.container.fromProps.baseUri,
containerId: cornusDb.container.fromProps.containerId,
userToken: AzuriteTest.service.userToken.admin,
});
expect(metadata.containerType).to.equal("workspace");

// __PUBLISH_EXTRACT_START__ WorkspaceExamples.CreatePatch
cornusDb.container.acquireWriteLock("Lief E. Greene");
const cornusPatchProps = (await cornusDb.container.createNewWorkspaceDbVersion({
Expand Down
Loading