Development #22732
notifications : possibilité de non expiration
0%
Description
Il est souhaité (#21614) de pouvoir avoir des notifications qui n'expirent pas (de manière heureuse ma spec de référence contient : "If 0, the notification never expires.")
(encore à discuter)
Fichiers
Révisions associées
tox.ini: use pytest-freezegun (#22732)
tests: use freezegun in test_notification (#22732)
notifications: allow notifications without an end_timestamp (#22732)
Those notifications will disappear only with an action of the user.
lingo: fix untested path in notify_new_remote_invoices (#22732)
Historique
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
- Fichier 0003-tests-use-freezegun-in-test_notification-22732.patch 0003-tests-use-freezegun-in-test_notification-22732.patch ajouté
- Fichier 0004-notifications-allow-notifications-without-an-end_tim.patch 0004-notifications-allow-notifications-without-an-end_tim.patch ajouté
- Fichier 0002-tox.ini-use-pytest-freezegun-22732.patch 0002-tox.ini-use-pytest-freezegun-22732.patch ajouté
- Fichier 0001-tests-create-global-fixtures-john.doe-and-jane.doe-2.patch 0001-tests-create-global-fixtures-john.doe-and-jane.doe-2.patch ajouté
- Fichier 0005-lingo-fix-untested-path-in-notify_new_remote_invoice.patch 0005-lingo-fix-untested-path-in-notify_new_remote_invoice.patch ajouté
- Patch proposed changé de Non à Oui
Au passage je corrige un bug dans le code pour oublier les notifications (en fait il est inutile on pourrait aussi le supprimer, car de fait si pay_limit_date < now, les notifications sont déjà cachées).
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
- Fichier 0003-tests-use-freezegun-in-test_notification-22732.patch 0003-tests-use-freezegun-in-test_notification-22732.patch ajouté
- Fichier 0004-notifications-allow-notifications-without-an-end_tim.patch 0004-notifications-allow-notifications-without-an-end_tim.patch ajouté
- Fichier 0002-tox.ini-use-pytest-freezegun-22732.patch 0002-tox.ini-use-pytest-freezegun-22732.patch ajouté
- Fichier 0001-tests-create-global-fixtures-john.doe-and-jane.doe-2.patch 0001-tests-create-global-fixtures-john.doe-and-jane.doe-2.patch ajouté
- Fichier 0005-lingo-fix-untested-path-in-notify_new_remote_invoice.patch 0005-lingo-fix-untested-path-in-notify_new_remote_invoice.patch ajouté
Mis à jour par Benjamin Dauvergne il y a environ 6 ans
Je n'avais pas lu le ticket lié, les derniers patchs font en sorte qu'un ack() sur une notification sans fin fasse aussi un forget() (on pourrait vouloir faire varier cela, par exemple plutôt qu'un forget donner un end_timestamp proche comme 1 jour).
Mis à jour par Frédéric Péters il y a presque 6 ans
Je viens de pousser ça dans wip/22732-notifications-without-expiration-rebase, à relire parce que rebase délicat.
Notamment parce que ça m'a fait relire des patchs passés genre https://dev.entrouvert.org/attachments/24576/0001-lingo-fix-notifications-expiration-for-expired-invoi.patch où je ne comprends toujours pas pourquoi l'ajout d'une facture à ignorer (c'est le cas que le commit corrige) ajoute malgré tout une notification au compte final.
Mis à jour par Frédéric Péters il y a presque 6 ans
Et réponse de Serghei à ça, c'est parce que dans le test (non visible), il y a un passage qui modifie les dates,
for username in FAKE_PENDING_INVOICES['data']: for invoice in FAKE_PENDING_INVOICES['data'][username]['invoices']: invoice['pay_limit_date'] = new_pay_limit_date
Comme ce passage est supprimé dans ces tests introduisant freezegun, il apparait donc normal que le compte de notification passe de 3 à 2.
Mis à jour par Emmanuel Cazenave il y a presque 6 ans
La property Notification.visible
ne tiens pas compte d'en éventuel end_timestamp
à None
.
Notification.ack peut se re-écrire en :
def ack(self): if self.end_timestamp: self.acked = True self.save(update_fields=['acked']) else: self.forget()
Et donc j'essaie de résumer le comportement que l'on obtiens ici : une notification sans expiration est visible ad vitam eternam tant qu'elle n'est pas 'ack' ou 'forget' ces deux actions devenant strictement équivalentes pour une notification de ce type.
Je manque de contexte pour comprendre si c'est bien ça que l'on veut mais si c'est bien ça alors très bien.
Mis à jour par Frédéric Péters il y a presque 6 ans
- Statut changé de En cours à Résolu (à déployer)
Allez, hop, envoyé tout ça.
commit 7ff1299e2f8292d28bbdca922010da4165a16d74 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Sat Mar 24 02:18:47 2018 +0100 lingo: fix untested path in notify_new_remote_invoices (#22732) commit dab07696ffc619cf4b3a1cd89b8020c9421c02c2 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Sat Mar 24 01:50:30 2018 +0100 notifications: allow notifications without an end_timestamp (#22732) Those notifications will disappear only with an action of the user. commit a16ee38a9994c97e04074bffa6464f0125f7520c Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Sat Mar 24 02:09:33 2018 +0100 tests: use freezegun in test_notification (#22732) commit 1e892549f9e43aa985ec3fd814c8a305a5582eac Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Sat Mar 24 02:09:52 2018 +0100 tox.ini: use pytest-freezegun (#22732) commit 4bb382806baf431a2f97dc76f0fa8be56953a364 Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Sat Mar 24 01:48:55 2018 +0100 tests: create global fixtures john.doe and jane.doe (#22732)
Mis à jour par Frédéric Péters il y a plus de 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
tests: create global fixtures john.doe and jane.doe (#22732)