Skip to content

Commit 0d7185b

Browse files
authored
Merge pull request #250 from NavAbility/24Q3/fix/update_be
Updates for blob entry bugfix
2 parents ec9c034 + d7dae5a commit 0d7185b

File tree

6 files changed

+35
-12
lines changed

6 files changed

+35
-12
lines changed

src/NavAbilitySDK.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ import DistributedFactorGraphs:
6060
getSessionBlobEntries,
6161
addSessionBlobEntry!,
6262
addSessionBlobEntries!,
63+
listSessionBlobEntries,
6364
exists,
6465
listNeighbors,
6566
findVariableNearTimestamp

src/graphql/Factor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ mutation deleteFactor($factorId: ID!) {
171171
delete: {
172172
blobEntries: {
173173
where: {
174-
node: { factorConnection_ALL: { node: { id: $factorId } } }
174+
node: { parentConnection: {Factor: { node: { id: $factorId } } } }
175175
}
176176
}
177177
}

src/graphql/UserRobotSession.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ mutation deleteSession($sessionId: ID!) {
141141
where: { id: $sessionId }
142142
delete: {
143143
blobEntries: {
144-
where: { node: { sessionConnection_ALL: { node: { id: $sessionId } } } }
144+
where: { node: { parentConnection: {Session: {node: {id: $sessionId } } } } }
145145
}
146146
}
147147
) {
@@ -160,7 +160,7 @@ mutation deleteRobot($robotId: ID!) {
160160
where: { id: $robotId }
161161
delete: {
162162
blobEntries: {
163-
where: { node: { robotConnection_ALL: { node: { id: $robotId } } } }
163+
where: { node: { parentConnection: {Robot: {node: {id: $robotId } } } } }
164164
}
165165
}
166166
) {

src/graphql/Variable/Variable.jl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ mutation deleteVariable($variableId: ID!) {
207207
}
208208
blobEntries: {
209209
where: {
210-
node: { variableConnection_ALL: { node: { id: $variableId } } }
210+
node: { parentConnection: {Variable: {node: {id: $variableId } } } }
211211
}
212212
}
213213
}
@@ -264,12 +264,14 @@ mutation deleteVariable(
264264
blobEntries: {
265265
where: {
266266
node: {
267-
variableConnection_ALL: {
268-
node: {
269-
userLabel: $userLabel
270-
robotLabel: $robotLabel
271-
sessionLabel: $sessionLabel
272-
label: $variableLabel
267+
parentConnection: {
268+
Variable: {
269+
node: {
270+
userLabel: $userLabel
271+
robotLabel: $robotLabel
272+
sessionLabel: $sessionLabel
273+
label: $variableLabel
274+
}
273275
}
274276
}
275277
}

src/services/Variable.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,23 @@ function VariableCreateInput(fgclient::DFGClient, v::Variable)
1616
robotLabel = fgclient.robot.label,
1717
sessionLabel = fgclient.session.label,
1818
variableLabel = string(variableLabel),
19+
parent =
20+
Dict("Variable" =>
21+
Dict("connect" =>
22+
Dict("where" =>
23+
Dict("node" =>
24+
Dict("AND" =>
25+
(
26+
userLabel = fgclient.user.label,
27+
robotLabel = fgclient.robot.label,
28+
sessionLabel = fgclient.session.label,
29+
label = string(variableLabel)
30+
)
31+
)
32+
)
33+
)
34+
)
35+
),
1936
getCommonProperties(BlobEntryCreateInput, entry)...,
2037
blobId = if isnothing(entry.blobId)
2138
entry.originId

test/integration/InterfaceTests.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ sessionLabel = get(ENV, "SESSION_ID", "TestSession_$(randstring(4))")
2626
display(fgclient)
2727

2828
# test easy constructor
29-
fgclient2 = DFGClient(userLabel, robotLabel, sessionLabel)
29+
fgclient2 = DFGClient(userLabel, robotLabel, sessionLabel; apiUrl)
3030
@test fgclient.session == fgclient2.session
3131

3232
end
@@ -37,7 +37,7 @@ end
3737

3838
user = NvaSDK.User(client, userLabel)
3939
@test user.id == UUID("d4bfaaf6-7d55-49eb-b03a-7806457e09d2")
40-
@test user.label == "guest@navability.io"
40+
@test user.label == userLabel
4141

4242
robot = addRobot!(client, user, temp_robotLabel)
4343
@test robot.label == temp_robotLabel
@@ -378,6 +378,9 @@ a_facts = addFactor!.(fgclient, facts)
378378

379379
end
380380

381+
deleteVariable!.(fgclient, listVariables(fgclient))
382+
deleteFactor!.(fgclient, getFactorsSkeleton(fgclient))
383+
deleteSession!(fgclient)
381384
# batch delete
382385
#TODO deleteVariables
383386
#TODO deleteFactors

0 commit comments

Comments
 (0)