mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 12:25:17 +00:00
fix auth error in transactor rcp (#7661)
Signed-off-by: Nikolay Chunosov <Chunosov.N@gmail.com>
This commit is contained in:
parent
6711ceb877
commit
e81100cbaf
@ -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
|
||||
|
@ -68,7 +68,7 @@ class TransactorRpcTarget extends RpcTarget {
|
||||
}
|
||||
|
||||
async getModel (): Promise<any> {
|
||||
return (this.transactor as any).getModel()
|
||||
return (this.transactor as any).getModel(this.token)
|
||||
}
|
||||
|
||||
async getAccount (): Promise<any> {
|
||||
|
@ -387,6 +387,7 @@ export class Transactor extends DurableObject<Env> {
|
||||
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<Env> {
|
||||
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<Env> {
|
||||
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<Env> {
|
||||
result = ret.transactions
|
||||
}
|
||||
} catch (error: any) {
|
||||
result = []
|
||||
return { error: `${error}` }
|
||||
} finally {
|
||||
await this.sessionManager.close(this.measureCtx, cs, this.workspace)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user