Skip to content

Commit

Permalink
Resolve bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaruiz717 committed Apr 29, 2024
1 parent 5720f9a commit a6c56a7
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions core/frontend/src/CheckpointConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,6 @@ export class CheckpointConnection extends IModelConnection {
return connection;
}

/**
* Open a readonly IModelConnection to a Checkpoint of an iModel from Ipc.
*/
public static async openFromIpc(args: OpenCheckpointArgs): Promise<CheckpointConnection> {
if (undefined === IModelApp.hubAccess)
throw new Error("Missing an implementation of IModelApp.hubAccess");

// IModelRpcOpenProps.changeset requires id to be present
if (undefined === args.changeset?.id)
throw new Error("Missing changeset id");

let connection: CheckpointConnection;
if (IpcApp.isValid) {
connection = new this(await IpcApp.appFunctionIpc.openCheckpoint(args), true);
} else {
const routingContext = IModelRoutingContext.current || IModelRoutingContext.default;
connection = new this(await this.callOpen({
iModelId: args.iModelId,
iTwinId: args.iTwinId,
changeset: {
id: args.changeset.id,
index: args.changeset?.index,
},
}, routingContext), false);
RpcManager.setIModel(connection);
connection.routingContext = routingContext;
RpcRequest.notFoundHandlers.addListener(connection._reopenConnectionHandler);
}

IModelConnection.onOpen.raiseEvent(connection);
return connection;
}

private static async callOpen(iModelToken: IModelRpcOpenProps, routingContext: IModelRoutingContext): Promise<IModelConnectionProps> {
// Try opening the iModel repeatedly accommodating any pending responses from the backend.
// Waits for an increasing amount of time (but within a range) before checking on the pending request again.
Expand Down

0 comments on commit a6c56a7

Please sign in to comment.