Skip to content

Commit

Permalink
adjust to NanoDates fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwro committed Aug 14, 2024
1 parent 40f79a0 commit 7003648
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ version = "2023.1.10"

[[deps.NanoDates]]
deps = ["Dates", "Parsers"]
git-tree-sha1 = "382971d0eaee7e6d8f86a8c418fff149d66e7fdb"
git-tree-sha1 = "22a4727a7e24fa9024dc8331b40ccf8a70f922c3"
uuid = "46f1a544-deae-4307-8689-c12aa3c955c6"
version = "0.3.3"
version = "1.0.2"

[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
Expand Down
4 changes: 1 addition & 3 deletions src/jetstream/api/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ end

function convert(::Type{Union{T, ApiError}}, msg::NATS.Msg) where { T <: ApiResponse }
# TODO: check headers
pl = NATS.payload(msg)
pl = replace(pl, "0001-01-01T00:00:00Z" => "0001-01-01T00:00:00.000Z")
response = JSON3.read(pl)
response = JSON3.read(@view msg.payload[begin+msg.headers_length:end])
if haskey(response, :error)
StructTypes.constructfrom(ApiError, response.error)
else
Expand Down
6 changes: 2 additions & 4 deletions src/jetstream/api/stream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ end
"Sequence number of the first message in the Stream"
first_seq::UInt64
"The timestamp of the first message in the Stream"
# first_ts::Union{NanoDate, Nothing} = nothing
first_ts::Union{String, Nothing} = nothing
first_ts::Union{NanoDate, Nothing} = nothing
"Sequence number of the last message in the Stream"
last_seq::UInt64
"The timestamp of the last message in the Stream"
# last_ts::Union{NanoDate, Nothing} = nothing
last_ts::Union{String, Nothing} = nothing
last_ts::Union{NanoDate, Nothing} = nothing
"IDs of messages that were deleted using the Message Delete API or Interest based streams removing messages out of order"
deleted::Union{Vector{UInt64}, Nothing} = nothing
# "Subjects and their message counts when a subjects_filter was set"
Expand Down

0 comments on commit 7003648

Please sign in to comment.