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

Futureon briefcase #658

Merged
merged 48 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a1c8fe6
edit bridgerunner to retrieve briefcaseId from prdss
admccarthy1 Jan 7, 2021
9322316
use argsJson for briefcaseId
admccarthy1 Jan 19, 2021
55cc4bb
fix error by replacing curly brace that got deleted
admccarthy1 Jan 21, 2021
20d10b8
fix formatting
admccarthy1 Jan 25, 2021
f4ef12d
return briefcaseId from synchronize
admccarthy1 Jan 25, 2021
07c7c81
correct formatting
admccarthy1 Jan 25, 2021
c0ea71a
return briefcaseId by setting argument
admccarthy1 Jan 25, 2021
6aa0798
cleanup
admccarthy1 Jan 25, 2021
a13e94a
fix undefined object errors
admccarthy1 Jan 26, 2021
cce3f20
Merge remote-tracking branch 'origin/master' into futureonBriefcase
admccarthy1 Jan 27, 2021
f4ad588
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 27, 2021
6f3bc4d
do rush change
admccarthy1 Jan 27, 2021
a093272
Merge branch 'futureonBriefcase' of /~https://github.com/imodeljs/imode…
admccarthy1 Jan 27, 2021
1393e88
fix formatting
admccarthy1 Jan 27, 2021
c3bdf85
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 27, 2021
3fa9016
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 27, 2021
2deb6a9
use camelcase to fix linting errors in build
admccarthy1 Jan 28, 2021
a14a210
Merge branch 'futureonBriefcase' of /~https://github.com/imodeljs/imode…
admccarthy1 Jan 28, 2021
c673530
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 28, 2021
5074af4
change to not overwrite arguments if something other than briefcaseId is
admccarthy1 Jan 28, 2021
cf39d7b
Merge branch 'futureonBriefcase' of /~https://github.com/imodeljs/imode…
admccarthy1 Jan 28, 2021
1f071eb
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 28, 2021
2831afc
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 28, 2021
2405bf2
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 29, 2021
a72b983
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 29, 2021
170564b
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 29, 2021
9902a00
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 29, 2021
b508369
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 29, 2021
225bf81
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 30, 2021
9f1f60d
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 30, 2021
30ad730
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 31, 2021
88ef09d
Merge branch 'master' into futureonBriefcase
mergify[bot] Jan 31, 2021
309e5fc
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
41a89da
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
81d4c07
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
e621275
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
61c7837
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
5397735
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
7ae4e6e
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
2d7e5c7
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 1, 2021
717dbfe
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 2, 2021
afa20f9
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 2, 2021
6e86700
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 2, 2021
5aa690c
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 2, 2021
0037547
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 3, 2021
c68259e
Merge branch 'master' into futureonBriefcase
mergify[bot] Feb 3, 2021
e809a60
formatting change for linter
admccarthy1 Feb 3, 2021
b1ee765
Merge branch 'futureonBriefcase' of /~https://github.com/imodeljs/imode…
admccarthy1 Feb 3, 2021
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,11 @@
{
"changes": [
{
"packageName": "@bentley/imodel-bridge",
"comment": "Allow briefcaseId to be passed in",
"type": "none"
}
],
"packageName": "@bentley/imodel-bridge",
"email": "admccarthy1@users.noreply.github.com"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@bentley/imodeljs-frontend",
"comment": "",
"type": "none"
}
],
"packageName": "@bentley/imodeljs-frontend",
"email": "admccarthy1@users.noreply.github.com"
}
15 changes: 8 additions & 7 deletions core/imodel-bridge/src/BridgeRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
BackendRequestContext, BriefcaseDb, BriefcaseManager, ComputeProjectExtentsOptions, ConcurrencyControl, IModelDb, IModelJsFs, IModelJsNative,
SnapshotDb, Subject, SubjectOwnsSubjects, UsageLoggingUtilities,
} from "@bentley/imodeljs-backend";
import { IModel, IModelError, OpenBriefcaseProps, SubjectProps } from "@bentley/imodeljs-common";
import { IModel, IModelError, LocalBriefcaseProps, OpenBriefcaseProps, SubjectProps } from "@bentley/imodeljs-common";
import { AccessToken, AuthorizedClientRequestContext } from "@bentley/itwin-client";
import { BridgeLoggerCategory } from "./BridgeLoggerCategory";
import { IModelBankArgs, IModelBankUtils } from "./IModelBankUtils";
Expand Down Expand Up @@ -314,7 +314,6 @@ abstract class IModelDbBuilder {
assert(this._imodel !== undefined);
return this._imodel;
}

}

class BriefcaseDbBuilder extends IModelDbBuilder {
Expand Down Expand Up @@ -469,7 +468,6 @@ class BriefcaseDbBuilder extends IModelDbBuilder {

/** This will download the briefcase, open it with the option to update the Db profile, close it, re-open with the option to upgrade core domain schemas */
public async acquire(): Promise<void> {

// ********
// ********
// ******** TODO: Where do we check if the briefcase is already on the local disk??
Expand All @@ -483,9 +481,13 @@ class BriefcaseDbBuilder extends IModelDbBuilder {
throw new Error("Must initialize ContextId before using");
if (this._serverArgs.iModelId === undefined)
throw new Error("Must initialize IModelId before using");

// First, download the briefcase
const props = await BriefcaseManager.downloadBriefcase(this._requestContext, { contextId: this._serverArgs.contextId, iModelId: this._serverArgs.iModelId });
let props: LocalBriefcaseProps;
if (this._bridgeArgs.argsJson && this._bridgeArgs.argsJson.BriefcaseId) {
props = await BriefcaseManager.downloadBriefcase(this._requestContext, {briefcaseId: this._bridgeArgs.argsJson.BriefcaseId, contextId: this._serverArgs.contextId, iModelId: this._serverArgs.iModelId});
} else {
props = await BriefcaseManager.downloadBriefcase(this._requestContext, {contextId: this._serverArgs.contextId, iModelId: this._serverArgs.iModelId});
this._bridgeArgs.argsJson= {BriefcaseId: props.briefcaseId};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this overwrite the additional parameters passed in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing it back in there is how we're returning the id so we can save the value to the settings service in the wrapper

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you instead do 'this._bridgeArgs.argsJson.BriefcaseId = props.briefcaseId' which preserves anything else previously set, and adds the id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had that but when i tested it I got an error because argsJson was undefined when I didn't pass anything in, I could null check it and only do it this way when its null and otherwise do it that way if we think thats better

}
let briefcaseDb: BriefcaseDb | undefined;
const openArgs: OpenBriefcaseProps = {
fileName: props.fileName,
Expand Down Expand Up @@ -553,5 +555,4 @@ class SnapshotDbBuilder extends IModelDbBuilder {
await this._bridge.updateExistingData();
this._imodel.saveChanges();
}

}