Skip to content

Commit

Permalink
Revert Fetch() behavior to not verify request ID (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpio authored Mar 24, 2023
1 parent 14e0d11 commit 261cfc5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions js.go
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ func (sub *Subscription) Fetch(batch int, opts ...PullOpt) ([]*Msg, error) {

nc := sub.conn
nms := sub.jsi.nms
rply, reqID := newFetchInbox(jsi.deliver)
rply, _ := newFetchInbox(jsi.deliver)
js := sub.jsi.js
pmc := len(sub.mch) > 0

Expand Down Expand Up @@ -2753,17 +2753,10 @@ func (sub *Subscription) Fetch(batch int, opts ...PullOpt) ([]*Msg, error) {
// wait this time.
noWait = false
err = sendReq()
} else if err == ErrTimeout {
} else if err == ErrTimeout && len(msgs) == 0 {
// If we get a 408, we will bail if we already collected some
// messages, otherwise ignore and go back calling nextMsg.
if len(msgs) == 0 {
err = nil
continue
}
// ignore timeout message from server if it comes from a different pull request
if reqID != "" && !subjectMatchesReqID(msg.Subject, reqID) {
err = nil
}
err = nil
}
}
}
Expand Down

0 comments on commit 261cfc5

Please sign in to comment.