diff --git a/workers/transactor/.editorconfig b/workers/transactor/.editorconfig index a727df347a..6874770725 100644 --- a/workers/transactor/.editorconfig +++ b/workers/transactor/.editorconfig @@ -2,11 +2,8 @@ root = true [*] -indent_style = tab +indent_style = space end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true - -[*.yml] -indent_style = space diff --git a/workers/transactor/src/index.ts b/workers/transactor/src/index.ts index 4a767b974e..ba70082abd 100644 --- a/workers/transactor/src/index.ts +++ b/workers/transactor/src/index.ts @@ -68,7 +68,7 @@ class TransactorRpcTarget extends RpcTarget { } async getModel (): Promise { - return (this.transactor as any).getModel() + return (this.transactor as any).getModel(this.token) } async getAccount (): Promise { diff --git a/workers/transactor/src/transactor.ts b/workers/transactor/src/transactor.ts index b2e3798781..c2d472ab18 100644 --- a/workers/transactor/src/transactor.ts +++ b/workers/transactor/src/transactor.ts @@ -387,6 +387,7 @@ export class Transactor extends DurableObject { const session = await this.makeRpcSession(rawToken, cs) const pipeline = session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline + ;(session as any).includeSessionContext(this.measureCtx, pipeline) result = await pipeline.findAll(this.measureCtx, _class, query ?? {}, options ?? {}) } catch (error: any) { result = { error: `${error}` } @@ -403,7 +404,8 @@ export class Transactor extends DurableObject { const session = await this.makeRpcSession(rawToken, cs) const pipeline = session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline - await pipeline.tx(this.measureCtx, [tx]) + ;(session as any).includeSessionContext(this.measureCtx, pipeline) + result = await pipeline.tx(this.measureCtx, [tx]) } catch (error: any) { result = { error: `${error}` } } finally { @@ -419,6 +421,7 @@ export class Transactor extends DurableObject { const session = await this.makeRpcSession(rawToken, cs) const pipeline = session.workspace.pipeline instanceof Promise ? await session.workspace.pipeline : session.workspace.pipeline + ;(session as any).includeSessionContext(this.measureCtx, pipeline) const ret = await pipeline.loadModel(this.measureCtx, 0) if (Array.isArray(ret)) { result = ret @@ -426,7 +429,7 @@ export class Transactor extends DurableObject { result = ret.transactions } } catch (error: any) { - result = [] + return { error: `${error}` } } finally { await this.sessionManager.close(this.measureCtx, cs, this.workspace) }