Skip to content

Commit

Permalink
core: fix threshold computation in syncFailed
Browse files Browse the repository at this point in the history
  • Loading branch information
jjanku committed May 19, 2024
1 parent 678237a commit f7b96be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion meesign_core/lib/src/data/task_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,11 @@ abstract class TaskRepository<T> {
final group = await _getAssociatedGroup(did, task);
final members = await _taskDao.getGroupMembers(group.tid);
final shareCount = members.map((m) => m.shares).sum;
final threshold =
rpcTask.type == rpc.TaskType.GROUP ? shareCount : group.threshold;

TaskError? error;
if (rpcTask.reject > shareCount - group.threshold) {
if (rpcTask.reject > shareCount - threshold) {
error = TaskError.rejected;
}

Expand Down

0 comments on commit f7b96be

Please sign in to comment.