desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Refactor ActivityListModel population mechanisms

Open claucambra opened this issue 2 years ago • 7 comments

Signed-off-by: Claudio Cambra [email protected]

As it stands, the ActivityListModel has two issues:

  1. It updates coarsely, bulldozing all prior data and replacing with newly-acquired data
  2. It has duplicated and messy code relating to inserting and removing rows from the model

This refactoring eliminates these issues, which in turn also prevents the activity list view resetting every time something changes (i.e. receiving new activities, dismissing notifications, etc.) by updating the core data list granularly rather than coarsely. This addresses a point in #4432

NOTE: this PR depends on #4735 as it removes the clearNotifications method which goes unused after the internal refactoring of ActivityListModel and the removal of clearNotifications from the UserModel in #4735

Fixes #4724

claucambra avatar Jul 14 '22 11:07 claucambra

Codecov Report

Merging #4736 (20c5f8e) into master (20c5f8e) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 20c5f8e differs from pull request most recent head 1a5fa50. Consider uploading reports for the commit 1a5fa50 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4736   +/-   ##
=======================================
  Coverage   57.20%   57.20%           
=======================================
  Files         138      138           
  Lines       17138    17138           
=======================================
  Hits         9804     9804           
  Misses       7334     7334           

codecov[bot] avatar Jul 15 '22 00:07 codecov[bot]

/backport to stable-3.5

claucambra avatar Jul 15 '22 12:07 claucambra

/backport to stable-3.5

I would prefer not to backport in case that would induce regressions

mgallien avatar Jul 25 '22 11:07 mgallien

It updates coarsely, bulldozing all prior data and replacing with newly-acquired data

Ahh nice, so this also fixes the issue of old Talk notifications which were already seen via other apps still showing up? :)

jancborchardt avatar Aug 10 '22 14:08 jancborchardt

It updates coarsely, bulldozing all prior data and replacing with newly-acquired data

Ahh nice, so this also fixes the issue of old Talk notifications which were already seen via other apps still showing up? :)

Not really; as I know we do not receive a list of completed notifications from the server which would let us filter out notifications from our presently-shown notifications. But this should prevent showing duplicates

claucambra avatar Aug 11 '22 09:08 claucambra

@claucambra Just, please don't forget to fix the build

allexzander avatar Sep 13 '22 16:09 allexzander

AppImage file: nextcloud-PR-4736-1a5fa50fbbfb006232fcc9d92733cdf2e9573056-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

nextcloud-desktop-bot avatar Sep 13 '22 18:09 nextcloud-desktop-bot