Skip to content

Commit

Permalink
Merge pull request #250 from NavAbility/24Q3/fix/update_be
Browse files Browse the repository at this point in the history
Updates for blob entry bugfix
  • Loading branch information
Affie authored Jul 19, 2024
2 parents ec9c034 + d7dae5a commit 0d7185b
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/NavAbilitySDK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import DistributedFactorGraphs:
getSessionBlobEntries,
addSessionBlobEntry!,
addSessionBlobEntries!,
listSessionBlobEntries,
exists,
listNeighbors,
findVariableNearTimestamp
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/Factor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mutation deleteFactor($factorId: ID!) {
delete: {
blobEntries: {
where: {
node: { factorConnection_ALL: { node: { id: $factorId } } }
node: { parentConnection: {Factor: { node: { id: $factorId } } } }
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/UserRobotSession.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ mutation deleteSession($sessionId: ID!) {
where: { id: $sessionId }
delete: {
blobEntries: {
where: { node: { sessionConnection_ALL: { node: { id: $sessionId } } } }
where: { node: { parentConnection: {Session: {node: {id: $sessionId } } } } }
}
}
) {
Expand All @@ -160,7 +160,7 @@ mutation deleteRobot($robotId: ID!) {
where: { id: $robotId }
delete: {
blobEntries: {
where: { node: { robotConnection_ALL: { node: { id: $robotId } } } }
where: { node: { parentConnection: {Robot: {node: {id: $robotId } } } } }
}
}
) {
Expand Down
16 changes: 9 additions & 7 deletions src/graphql/Variable/Variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ mutation deleteVariable($variableId: ID!) {
}
blobEntries: {
where: {
node: { variableConnection_ALL: { node: { id: $variableId } } }
node: { parentConnection: {Variable: {node: {id: $variableId } } } }
}
}
}
Expand Down Expand Up @@ -264,12 +264,14 @@ mutation deleteVariable(
blobEntries: {
where: {
node: {
variableConnection_ALL: {
node: {
userLabel: $userLabel
robotLabel: $robotLabel
sessionLabel: $sessionLabel
label: $variableLabel
parentConnection: {
Variable: {
node: {
userLabel: $userLabel
robotLabel: $robotLabel
sessionLabel: $sessionLabel
label: $variableLabel
}
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions src/services/Variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,23 @@ function VariableCreateInput(fgclient::DFGClient, v::Variable)
robotLabel = fgclient.robot.label,
sessionLabel = fgclient.session.label,
variableLabel = string(variableLabel),
parent =
Dict("Variable" =>
Dict("connect" =>
Dict("where" =>
Dict("node" =>
Dict("AND" =>
(
userLabel = fgclient.user.label,
robotLabel = fgclient.robot.label,
sessionLabel = fgclient.session.label,
label = string(variableLabel)
)
)
)
)
)
),
getCommonProperties(BlobEntryCreateInput, entry)...,
blobId = if isnothing(entry.blobId)
entry.originId
Expand Down
7 changes: 5 additions & 2 deletions test/integration/InterfaceTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ sessionLabel = get(ENV, "SESSION_ID", "TestSession_$(randstring(4))")
display(fgclient)

# test easy constructor
fgclient2 = DFGClient(userLabel, robotLabel, sessionLabel)
fgclient2 = DFGClient(userLabel, robotLabel, sessionLabel; apiUrl)
@test fgclient.session == fgclient2.session

end
Expand All @@ -37,7 +37,7 @@ end

user = NvaSDK.User(client, userLabel)
@test user.id == UUID("d4bfaaf6-7d55-49eb-b03a-7806457e09d2")
@test user.label == "[email protected]"
@test user.label == userLabel

robot = addRobot!(client, user, temp_robotLabel)
@test robot.label == temp_robotLabel
Expand Down Expand Up @@ -378,6 +378,9 @@ a_facts = addFactor!.(fgclient, facts)

end

deleteVariable!.(fgclient, listVariables(fgclient))
deleteFactor!.(fgclient, getFactorsSkeleton(fgclient))
deleteSession!(fgclient)
# batch delete
#TODO deleteVariables
#TODO deleteFactors

0 comments on commit 0d7185b

Please sign in to comment.