Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty list on getBlobEntries #236

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/NavAbilitySDK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ include("entities/VariableTypes.jl")
include("entities/UserRobotSession.jl")
include("entities/Variable.jl")
include("entities/Factor.jl")
include("entities/BlobStore.jl")

include("NavAbilityClient.jl")

Expand Down
14 changes: 14 additions & 0 deletions src/entities/BlobStore.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#TODO we can also extend the blobstore
struct NavAbilityBlobStore <: DFG.AbstractBlobStore{Vector{UInt8}}
key::Symbol
client::GQL.Client
userLabel::String
end

struct NavAbilityCachedBlobStore{T <: DFG.AbstractBlobStore} <:
DFG.AbstractBlobStore{Vector{UInt8}}
key::Symbol
localstore::T
remotestore::NavAbilityBlobStore
end
7 changes: 6 additions & 1 deletion src/services/BlobEntry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ function getBlobEntries(fgclient::DFGClient, variableLabel::Symbol)
throw_on_execution_error = true,
)

return response.data["users"][1]["robots"][1]["sessions"][1]["variables"][1]["blobEntries"]
varret = response.data["users"][1]["robots"][1]["sessions"][1]["variables"]
if 0 < length(varret)
return varret[1]["blobEntries"]
else
return BlobEntry[]
end
end

function addBlobEntry!(fgclient::DFGClient, variableLabel::Symbol, entry::DFG.BlobEntry)
Expand Down
12 changes: 0 additions & 12 deletions src/services/BlobStore.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#TODO we can also extend the blobstore
struct NavAbilityBlobStore <: DFG.AbstractBlobStore{Vector{UInt8}}
key::Symbol
client::GQL.Client
userLabel::String
end

NavAbilityBlobStore(client::GQL.Client, userLabel::String) = NavAbilityBlobStore(:NAVABILITY, client, userLabel)

Expand All @@ -18,12 +12,6 @@ function NavAbilityBlobStore(fgclient::DFGClient)
NavAbilityBlobStore(:NAVABILITY, fgclient.client, fgclient.user.label)
end

struct NavAbilityCachedBlobStore{T <: DFG.AbstractBlobStore} <:
DFG.AbstractBlobStore{Vector{UInt8}}
key::Symbol
localstore::T
remotestore::NavAbilityBlobStore
end

function NavAbilityCachedBlobStore(localstore::DFG.AbstractBlobStore, remotestore::NavAbilityBlobStore)
return NavAbilityCachedBlobStore(:default_nva_cached, localstore, remotestore)
Expand Down