Improve notification management #561

Злито
Plume_migration_agent злито 4 комітів з notifications до master 5 роки тому
trinity-1686a прокоментував(ла) 5 роки тому
Власник

fix #472
fix #505

fix #472 fix #505
elegaanz (Перенесено з github.com) рецензовано 5 роки тому
elegaanz (Перенесено з github.com) прокоментував(ла) 5 роки тому

Shouln't this be .any(...)? Because I'm still getting duplicated notifications.

Shouln't this be `.any(...)`? Because I'm still getting duplicated notifications.
elegaanz (Перенесено з github.com) рецензовано 5 роки тому
elegaanz (Перенесено з github.com) прокоментував(ла) 5 роки тому

Also, AsActor::is_local is technically broken, since it only does instance_id == 1 which is not always correct (even if it is most of the time (like, unless you ran plm instance new twice, it will probably be correct)).

Maybe we should have a global storing the local instance info somewhere BTW (loaded only once when the app starts)? It would probably avoid a lot of queries to the database, and would allow to fix this issue without changing AsActor definition (but probably in another PR if we ever do it).

Also, `AsActor::is_local` is technically broken, since it only does `instance_id == 1` which is not always correct (even if it is most of the time (like, unless you ran `plm instance new` twice, it will probably be correct)). Maybe we should have a global storing the local instance info somewhere BTW (loaded only once when the app starts)? It would probably avoid a lot of queries to the database, and would allow to fix this issue without changing `AsActor` definition (but probably in another PR if we ever do it).
trinity-1686a рецензовано 5 роки тому
trinity-1686a прокоментував(ла) 5 роки тому
Автор
Власник

if all mentioned users are different from this author, send notification. I think it's correct, and when I tested it, it seemed to work.
Edit : My bad, forgot to add some file

if *all* mentioned users are different from this author, send notification. I think it's correct, and when I tested it, it seemed to work. Edit : My bad, forgot to add some file
codecov[bot] прокоментував(ла) 5 роки тому (Перенесено з github.com)

Codecov Report

Merging #561 into master will decrease coverage by <.01%.
The diff coverage is 54.34%.

@@            Coverage Diff             @@
##           master     #561      +/-   ##
==========================================
- Coverage   35.05%   35.05%   -0.01%     
==========================================
  Files          67       67              
  Lines        7834     7843       +9     
  Branches     1877     1885       +8     
==========================================
+ Hits         2746     2749       +3     
- Misses       4331     4332       +1     
- Partials      757      762       +5
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/561?src=pr&el=h1) Report > Merging [#561](https://codecov.io/gh/Plume-org/Plume/pull/561?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/918bda14ececc7f72b5741896c2c7ca8fba114f9?src=pr&el=desc) will **decrease** coverage by `<.01%`. > The diff coverage is `54.34%`. ```diff @@ Coverage Diff @@ ## master #561 +/- ## ========================================== - Coverage 35.05% 35.05% -0.01% ========================================== Files 67 67 Lines 7834 7843 +9 Branches 1877 1885 +8 ========================================== + Hits 2746 2749 +3 - Misses 4331 4332 +1 - Partials 757 762 +5 ```
elegaanz (Перенесено з github.com) рецензовано 5 роки тому
elegaanz (Перенесено з github.com) прокоментував(ла) 5 роки тому

Oh, I found what is wrong I think: the mention was inserted after the comment in the database.

Oh, I found what is wrong I think: the mention was inserted after the comment in the database.
elegaanz (Перенесено з github.com) рецензовано 5 роки тому
elegaanz (Перенесено з github.com) прокоментував(ла) 5 роки тому

OK, I'm too late, you already found it.

OK, I'm too late, you already found it.
elegaanz (Перенесено з github.com) зміни затверджено 5 роки тому
elegaanz (Перенесено з github.com) додав коментар

Seems to work! Thank you! 😊

Seems to work! Thank you! :blush:

Рецензенти

Запит на злиття був влитиий як c9070930d2.
Також можна переглянути інструкції для командного рядка.

Крок 1:

У репозиторії вашого проєкту перевірте нову гілку і протестуйте зміни.
git checkout -b notifications master
git pull origin notifications

Крок 2:

Об'єднати зміни і оновити на Forgejo.
git checkout master
git merge --no-ff notifications
git push origin master
Підпишіться щоб приєднатися до обговорення.
Немає рецензентів
Етап відсутній
Немає виконавця
2 учасників
Сповіщення
Дата завершення
Термін дії не дійсний або знаходиться за межами допустимого діапазону. Будь ласка використовуйте формат 'yyyy-mm-dd'.

Термін виконання не встановлений.

Залежності

No dependencies set.

Reference: Plume/Plume#561
Завантаження…
Тут ще немає жодного змісту.