Commit 36d0837
committed
feat(chat): mark message prefetch requests as such
The client fetches a room's messages before the user asks for them, from
a push notification and after a conversation list sync, and on the wire
those requests are indistinguishable from the ones a user waiting on a
chat screen is making. A server operator looking at request volume
cannot tell what was speculative and what someone was waiting for.
Send prefetch=1 on the chat requests the catch-up makes. The server
ignores the parameter - the response is byte for byte the one it sends
without it - so this only makes the traffic legible in an access log,
where a query parameter needs no configuration to be recorded.
The flag travels the same route as markNotificationsAsRead, which
already separates these two cases, and defaults to false: the helpers
that build the request are shared with the chat the user has open, and
labelling those as prefetched would invert the very distinction this is
for.
Assisted-by: Claude Code:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>1 parent f7eb4c3 commit 36d0837
2 files changed
Lines changed: 69 additions & 7 deletions
File tree
- app/src
- main/java/com/nextcloud/talk/chat/data/network
- test/java/com/nextcloud/talk/chat/data/network
Lines changed: 23 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
| |||
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
353 | | - | |
| 358 | + | |
| 359 | + | |
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
357 | 363 | | |
358 | 364 | | |
359 | 365 | | |
360 | 366 | | |
361 | | - | |
| 367 | + | |
| 368 | + | |
362 | 369 | | |
363 | 370 | | |
364 | 371 | | |
| |||
399 | 406 | | |
400 | 407 | | |
401 | 408 | | |
| 409 | + | |
402 | 410 | | |
403 | 411 | | |
404 | 412 | | |
| |||
413 | 421 | | |
414 | 422 | | |
415 | 423 | | |
| 424 | + | |
416 | 425 | | |
417 | 426 | | |
418 | 427 | | |
| |||
426 | 435 | | |
427 | 436 | | |
428 | 437 | | |
429 | | - | |
| 438 | + | |
| 439 | + | |
430 | 440 | | |
431 | 441 | | |
432 | 442 | | |
| |||
445 | 455 | | |
446 | 456 | | |
447 | 457 | | |
| 458 | + | |
448 | 459 | | |
449 | 460 | | |
450 | 461 | | |
| |||
462 | 473 | | |
463 | 474 | | |
464 | 475 | | |
465 | | - | |
| 476 | + | |
| 477 | + | |
466 | 478 | | |
467 | 479 | | |
468 | 480 | | |
| |||
478 | 490 | | |
479 | 491 | | |
480 | 492 | | |
| 493 | + | |
481 | 494 | | |
482 | 495 | | |
483 | 496 | | |
| |||
510 | 523 | | |
511 | 524 | | |
512 | 525 | | |
| 526 | + | |
513 | 527 | | |
514 | 528 | | |
515 | 529 | | |
| |||
527 | 541 | | |
528 | 542 | | |
529 | 543 | | |
530 | | - | |
| 544 | + | |
| 545 | + | |
531 | 546 | | |
532 | 547 | | |
533 | 548 | | |
| |||
569 | 584 | | |
570 | 585 | | |
571 | 586 | | |
572 | | - | |
| 587 | + | |
| 588 | + | |
573 | 589 | | |
574 | 590 | | |
575 | 591 | | |
| |||
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
103 | 149 | | |
104 | 150 | | |
105 | 151 | | |
| |||
0 commit comments