nats-io / nats-server

High-Performance server for NATS.io, the cloud and edge native messaging system.
https://nats.io
Apache License 2.0
16.01k stars 1.41k forks source link

Do not require "seq" field on DIRECT GET with "up_to_time" supplied #6029

Closed scottf closed 2 weeks ago

scottf commented 1 month ago

Observed behavior

A direct message request, with an up_to_time but no seq (starting sequence) fails with status message "408 Empty Request" instead of returning messages.

Proposed change

Default the seq to 1

Server version

Server v2.11.0-dev

Steps to reproduce

Create a new stream and publish 5 messages. Post a DIRECT.GET like {"batch":5,"up_to_time":"2024-10-21T16:45:15.772872800Z"} and one with {"batch":5,"up_to_time":""2024-10-21T16:45:15.772872800Z","seq":1}

scottf commented 2 weeks ago

Not applicable, up-to-time intended for multi last for