Skip to content

Commit f7fd211

Browse files
authored
Merge pull request #4166 from nextcloud/fix/set-logs-to-processed
Fix setting log entries to processed on sent notification
2 parents abcbd4f + 91a01ee commit f7fd211

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
# Changelog
66
All notable changes to this project will be documented in this file.
77

8-
## [Unreleased]
8+
## [8.1.4] - 2025-07-15
99
### Fixes
1010
- Fixed some typos
1111
- Removed inaccessible polls from polls overview
1212
- Removed link target from inaccessible polls in navigation
1313
- Removed clone action from inaccessible polls in navigation
1414
- Fixed visual bug when scrolling in list view
15+
- Fixed exception on notifications which may cause resending notification mails
1516

1617
### changes
1718
- Center poll table

lib/Db/LogMapper.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
namespace OCA\Polls\Db;
1010

1111
use OCP\AppFramework\Db\QBMapper;
12+
use OCP\DB\QueryBuilder\IQueryBuilder;
1213
use OCP\IDBConnection;
1314

1415
/**
@@ -31,7 +32,8 @@ public function findUnprocessed(): array {
3132

3233
$qb->select('*')
3334
->from($this->getTableName())
34-
->where($qb->expr()->isNotNull('poll_id'));
35+
->where($qb->expr()->isNotNull('poll_id'))
36+
->andWhere($qb->expr()->eq('processed', $qb->expr()->literal(0, IQueryBuilder::PARAM_INT)));
3537
return $this->findEntities($qb);
3638
}
3739

lib/Service/MailService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ public function sendNotifications(): void {
172172
}
173173

174174
foreach ($this->logs as $logItem) {
175-
$logItem->setProcessed(time());
175+
$logItem->setProcessed(intval(microtime(true) * 1000));
176176
$this->logMapper->update($logItem);
177+
usleep(5000);
177178
}
178179
}
179180

0 commit comments

Comments
 (0)