diff options
| author | 2024-08-17 16:25:40 +0200 | |
|---|---|---|
| committer | 2024-08-17 16:25:40 +0200 | |
| commit | bb61f698e8d3dcc980ea2a6a7c46d4905a1608c6 (patch) | |
| tree | 4b51ad2745902a8f7123da0733c7fcd3f0cea471 /app | |
| parent | c480e571619c2e68000d85b866ef23c89ad83ddf (diff) | |
Fix HTTP cache of main page (#6719)
Revert bug introduce by https://github.com/FreshRSS/FreshRSS/pull/3096 in which username was always null, preventing HTTP cache from working and always returning 200 instead of 304.
Discovered when checking https://github.com/FreshRSS/FreshRSS/pull/6718
Diffstat (limited to 'app')
| -rw-r--r-- | app/Models/EntryDAO.php | 3 | ||||
| -rw-r--r-- | app/Models/EntryDAOSQLite.php | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index cd8373766..a90b98a60 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -373,7 +373,6 @@ SQL; * @return int|false affected rows */ public function markRead($ids, bool $is_read = true) { - FreshRSS_UserDAO::touch(); if (is_array($ids)) { //Many IDs at once if (count($ids) < 6) { //Speed heuristics $affected = 0; @@ -391,6 +390,7 @@ SQL; return $affected; } + FreshRSS_UserDAO::touch(); $sql = 'UPDATE `_entry` ' . 'SET is_read=? ' . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1) . '?)'; @@ -408,6 +408,7 @@ SQL; } return $affected; } else { + FreshRSS_UserDAO::touch(); $sql = 'UPDATE `_entry` e INNER JOIN `_feed` f ON e.id_feed=f.id ' . 'SET e.is_read=?,' . 'f.`cache_nbUnreads`=f.`cache_nbUnreads`' . ($is_read ? '-' : '+') . '1 ' diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php index 364d0c153..d6364fec9 100644 --- a/app/Models/EntryDAOSQLite.php +++ b/app/Models/EntryDAOSQLite.php @@ -83,7 +83,6 @@ SQL; */ #[\Override] public function markRead($ids, bool $is_read = true) { - FreshRSS_UserDAO::touch(); if (is_array($ids)) { //Many IDs at once (used by API) //if (true) { //Speed heuristics //TODO: Not implemented yet for SQLite (so always call IDs one by one) $affected = 0; @@ -93,6 +92,7 @@ SQL; return $affected; //} } else { + FreshRSS_UserDAO::touch(); $this->pdo->beginTransaction(); $sql = 'UPDATE `_entry` SET is_read=? WHERE id=? AND is_read=?'; $values = [$is_read ? 1 : 0, $ids, $is_read ? 0 : 1]; |
