Skip to content

Commit fcacdde

Browse files
committed
Small serialization fixes
1 parent caf0c80 commit fcacdde

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/Common.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ global _invalidIds = [
7272
"VARIABLE", "FACTOR", "ENVIRONMENT",
7373
"PPE", "DATA_ENTRY", "FACTORGRAPH"]
7474

75-
global _validLabelRegex = r"^[a-zA-Z][\w\.\@]*$"
75+
global _validLabelRegex = r"^[a-zA-Z][-\w\.\@]*$"
7676

7777
"""
7878
$(SIGNATURES)

src/services/AbstractDFG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ function findVariableNearTimestamp(dfg::AbstractDFG,
905905
end
906906

907907
findVariableNearTimestamp(dfg::AbstractDFG, timest::DateTime, regexFilter::Union{Nothing, Regex}=nothing;
908-
timezone=localzone(), kwargs...) =
908+
timezone=tz"UTC", kwargs...) =
909909
findVariableNearTimestamp(dfg, ZonedDateTime(timest, timezone), regexFilter; kwargs...)
910910

911911
##==============================================================================

src/services/Serialization.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ function unpackFactor(
322322

323323
fullFactorData = nothing
324324
try
325-
packedFnc = fncStringToData(factor.fnctype, factor.data)
325+
if factor.data[1] == '{'
326+
packedFnc = fncStringToData(factor.fnctype, factor.data)
327+
else
328+
packedFnc = fncStringToData(factor.fnctype, String(base64decode(factor.data)))
329+
end
326330
decodeType = getFactorOperationalMemoryType(dfg)
327331
fullFactorData = decodePackedType(dfg, factor._variableOrderSymbols, decodeType, packedFnc)
328332
catch ex

0 commit comments

Comments
 (0)