Skip to content

Commit 42e0969

Browse files
committed
server: dropped events in stream when resuming with minseq
1 parent 507e133 commit 42e0969

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

github/server/src/variety/basic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,9 @@ pub(crate) async fn details(
16201620
*/
16211621
out += "function basic_onload() {}\n";
16221622
} else {
1623-
out += &app.templates.load("variety/basic/live.js")?
1623+
out += &app
1624+
.templates
1625+
.load("variety/basic/live.js")?
16241626
.replace("%LOCAL_TIME%", &local_time.to_string())
16251627
.replace("%CHECKRUN%", &cr.id.to_string())
16261628
.replace("%MINSEQ%", &minseq.to_string());

server/src/api/user.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,13 @@ pub(crate) async fn job_watch(
155155
*/
156156
let mut resuming = false;
157157
if let Some(minseq) =
158-
query.into_inner().minseq.and_then(|n| n.try_into().ok())
158+
query.into_inner().minseq.and_then(|n| u32::try_from(n).ok())
159159
{
160-
seq = minseq;
160+
/*
161+
* The "seq" value refers to the last record we have seen, but the
162+
* "minseq" parameter specifies the next record we _want_ to see.
163+
*/
164+
seq = minseq.saturating_sub(1);
161165
if minseq > 1 {
162166
resuming = true;
163167
}

0 commit comments

Comments
 (0)