File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 80
80
if ( answer . oldest . epoch > until ) {
81
81
let tooNew = answer . oldest
82
82
// first find a good starting cursor
83
- while ( answer . oldest . epoch > until ) {
83
+ while ( answer . oldest ?. epoch && answer . oldest . epoch > until ) {
84
84
tooNew = answer . oldest
85
85
86
86
const rate = ( answer . newest . id - answer . oldest . id ) / ( answer . newest . epoch - answer . oldest . epoch )
87
87
let cursor = Math . floor ( answer . oldest . id - rate * ( answer . oldest . epoch - until ) )
88
88
answer = await getAtCursor ( cursor )
89
89
}
90
90
91
- while ( answer . newest . epoch < until ) {
91
+ while ( answer . newest ?. epoch && answer . newest . epoch < until ) {
92
92
const tooOldID = answer . newest . id
93
93
// we overshot, now the time window does not include `until`, backtrack via bisecting
94
94
const rate = ( tooNew . id - answer . newest . id ) / ( tooNew . epoch - answer . newest . epoch )
101
101
}
102
102
}
103
103
104
- while ( answer . oldest . epoch > until ) {
104
+ while ( answer . oldest ?. epoch && answer . oldest . epoch > until ) {
105
105
// we overshot, maybe again, now even the oldest is too new
106
106
answer = await getAtCursor ( answer . oldest . id - 1 )
107
107
}
108
108
}
109
109
110
110
const events = [ ...answer . events ]
111
- while ( answer . oldest . epoch > since ) {
111
+ while ( answer . oldest ?. epoch && answer . oldest . epoch > since ) {
112
112
answer = await getAtCursor ( answer . oldest . id - 1 )
113
113
events . push ( ...answer . events )
114
114
}
You can’t perform that action at this time.
0 commit comments