Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Also deserialize tx metadata in RX backend
Signed-off-by: Antonio Barcelos <antonio.barcelos@neo4j.com>
  • Loading branch information
robsdedude authored and bigmontz committed Dec 8, 2022
commit 0b2ea62091f43b0ee00d3f4bb7c4a54c00f191ba
14 changes: 10 additions & 4 deletions packages/testkit-backend/src/request-handlers-rx.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ export function SessionClose (_, context, data, wire) {
}

export function SessionRun (_, context, data, wire) {
const { sessionId, cypher, params, txMeta: metadata, timeout } = data
const { sessionId, cypher, timeout } = data
const session = context.getSession(sessionId)
const params = context.binder.objectToNative(data.params)
const metadata = context.binder.objectToNative(data.txMeta)

if (params) {
for (const [key, value] of Object.entries(params)) {
params[key] = context.binder.cypherToNative(value)
Expand Down Expand Up @@ -112,8 +115,9 @@ export function ResultConsume (_, context, data, wire) {
}

export function SessionBeginTransaction (_, context, data, wire) {
const { sessionId, txMeta: metadata, timeout } = data
const { sessionId, timeout } = data
const session = context.getSession(sessionId)
const metadata = context.binder.objectToNative(data.txMeta)

try {
return session.beginTransaction({ metadata, timeout })
Expand Down Expand Up @@ -188,8 +192,9 @@ export function TransactionClose (_, context, data, wire) {
}

export function SessionReadTransaction (_, context, data, wire) {
const { sessionId, txMeta: metadata } = data
const { sessionId } = data
const session = context.getSession(sessionId)
const metadata = context.binder.objectToNative(data.txMeta)

try {
return session.executeRead(tx => {
Expand All @@ -207,8 +212,9 @@ export function SessionReadTransaction (_, context, data, wire) {
}

export function SessionWriteTransaction (_, context, data, wire) {
const { sessionId, txMeta: metadata } = data
const { sessionId } = data
const session = context.getSession(sessionId)
const metadata = context.binder.objectToNative(data.txMeta)

try {
return session.executeWrite(tx => {
Expand Down
2 changes: 2 additions & 0 deletions packages/testkit-backend/src/request-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ export function SessionReadTransaction (_, context, data, wire) {
const { sessionId } = data
const session = context.getSession(sessionId)
const metadata = context.binder.objectToNative(data.txMeta)

return session
.executeRead(
tx =>
Expand Down Expand Up @@ -329,6 +330,7 @@ export function SessionWriteTransaction (_, context, data, wire) {
const { sessionId } = data
const session = context.getSession(sessionId)
const metadata = context.binder.objectToNative(data.txMeta)

return session
.executeWrite(
tx =>
Expand Down