From c186a575f68ae4176224f082c39e305fba362f75 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Wed, 3 Jun 2020 14:11:25 +0200 Subject: [PATCH] Fixed incomplete autoupdates A conceptional issue in `get_data_since` leads to incomplete autoupdates. The behaviour was long time in the code, but only with a lot of autoupdates (high concurrency) and the autoupdate delay I noticed the bug during testing. I'm sure, that this issue might have caused incomplete autoupdates (which the user may experience as "lost autoupdates") in previous productive instances. Instead of quering a range (from_change_id to to_change_id) one now can only get data from a change id up to the max change id in the element cache. The max change id gets now returned by `get_data_since`. I also added a get_all_data with the capability of returning the max_change_id at this point of time. As a usability-"fix" (more like a fix the result of a bug, not the bug itself) a refresh button for a poll was added, that issues an autoupdate for the poll and all options. --- .../assignment-poll.component.html | 8 ++ .../motion-poll/motion-poll.component.html | 6 ++ .../polls/components/base-poll.component.ts | 4 + .../poll-progress/poll-progress.component.ts | 72 +++++++++------ .../services/base-poll-repository.service.ts | 15 +-- openslides/poll/views.py | 15 +++ openslides/utils/autoupdate.py | 43 +++++---- openslides/utils/cache.py | 43 ++++++--- openslides/utils/cache_providers.py | 91 +++++++++++++++---- .../utils/consumer_autoupdate_strategy.py | 20 ++-- openslides/utils/rest_api.py | 4 +- tests/test_case.py | 2 +- tests/unit/utils/test_cache.py | 29 ++++-- 13 files changed, 246 insertions(+), 106 deletions(-) diff --git a/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.html b/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.html index ba7e7fec9..8131d58c7 100644 --- a/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.html +++ b/client/src/app/site/assignments/components/assignment-poll/assignment-poll.component.html @@ -119,11 +119,19 @@ {{ 'Ballot papers' | translate }} + + + + +
+ + +