Commit 7793458
msglist: Set haveNewest from response, like haveOldest
This is NFC with a correctly-behaved server: we set `anchor=newest`,
so the server always sets `found_newest` to true.
Conversely, this will be helpful as we generalize `fetchInitial` to
work with other anchor values; we'll use the `found_newest` value
given by the server, without trying to predict it from the anchor.
The server behavior that makes this effectively NFC isn't quite
explicit in the API docs. Those say:
found_newest: boolean
Whether the server promises that the messages list includes the
very newest messages matching the narrow (used by clients that
paginate their requests to decide whether there may be more
messages to fetch).
https://zulip.com/api/get-messages#response
But with `anchor=newest`, the response does need to include the very
newest messages in the narrow -- that's the meaning of that `anchor`
value. So the server is in fact promising the list includes those,
and `found_newest` is therefore required to be true.
(And indeed in practice the server does set `found_newest` to true
when `anchor=newest`; it has specific logic to do so.)1 parent 6ff889b commit 7793458
File tree
3 files changed
+54
-3
lines changed- lib/model
- test
- model
3 files changed
+54
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
570 | 570 | | |
571 | 571 | | |
572 | 572 | | |
573 | | - | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
611 | 631 | | |
612 | 632 | | |
613 | 633 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
185 | 186 | | |
186 | 187 | | |
187 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
188 | 207 | | |
189 | 208 | | |
190 | 209 | | |
| |||
421 | 440 | | |
422 | 441 | | |
423 | 442 | | |
424 | | - | |
425 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
426 | 457 | | |
427 | 458 | | |
428 | 459 | | |
| |||
0 commit comments