summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2024-03-13 09:54:19 +0100
committerJoas Schilling <coding@schilljs.com>2024-03-13 09:54:19 +0100
commit25c9306ef7bf320d75ae962f17a1153df52eb849 (patch)
tree5db594905d4439f136712d15aba9e03555c57577 /lib
parentfb10ecd1822bd3b7818e4cd5df448e2ff6c0fb59 (diff)
fix(federation): Write chat value again when it was empty even when there is nothing new
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Federation/Proxy/TalkV1/Controller/ChatController.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Federation/Proxy/TalkV1/Controller/ChatController.php b/lib/Federation/Proxy/TalkV1/Controller/ChatController.php
index 9a6c0f099..4aee7fabc 100644
--- a/lib/Federation/Proxy/TalkV1/Controller/ChatController.php
+++ b/lib/Federation/Proxy/TalkV1/Controller/ChatController.php
@@ -173,6 +173,12 @@ class ChatController {
);
if ($proxy->getStatusCode() === Http::STATUS_NOT_MODIFIED) {
+ if ($lookIntoFuture && $this->proxyCacheMessages instanceof ICache) {
+ $cacheData = $this->proxyCacheMessages->get($cacheKey);
+ if ($cacheData === null || $cacheData < $lastKnownMessageId) {
+ $this->proxyCacheMessages->set($cacheKey, $lastKnownMessageId, 300);
+ }
+ }
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
}
@@ -182,7 +188,7 @@ class ChatController {
}
if ($proxy->getHeader('X-Chat-Last-Given')) {
$headers['X-Chat-Last-Given'] = (string) (int) $proxy->getHeader('X-Chat-Last-Given');
- if ($this->proxyCacheMessages instanceof ICache) {
+ if ($lookIntoFuture && $this->proxyCacheMessages instanceof ICache) {
$cacheData = $this->proxyCacheMessages->get($cacheKey);
if ($cacheData === null || $cacheData < $headers['X-Chat-Last-Given']) {
$this->proxyCacheMessages->set($cacheKey, (int) $headers['X-Chat-Last-Given'], 300);