calculate server progress based on last message, nowtime, and message flow; display progress on group contact and remote server #340

Merged
dan merged 3 commits from serverProgress into trunk 2022-02-02 18:05:50 +00:00
Owner

also remoteServer should have been its own model so now is

also remoteServer should have been its own model so now is
Member
Drone Build Status: failure https://build.openprivacy.ca/cwtch.im/cwtch-ui/530
dan force-pushed serverProgress from d93287d937 to a4ce168aec 2022-01-27 01:17:19 +00:00 Compare
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/531
sarah requested changes 2022-01-27 17:48:01 +00:00
sarah left a comment
Owner

Let's not pollute contact with server specific fields. Instead have whatever needs to refer to _serverSyncProgress lookup _server and if it exists then consult the server model instead.

Let's not pollute contact with server specific fields. Instead have whatever needs to refer to `_serverSyncProgress` lookup `_server` and if it exists then consult the server model instead.
@ -26,6 +26,7 @@ class ContactInfoState extends ChangeNotifier {
// todo: a nicer way to model contacts, groups and other "entities"
late bool _isGroup;
String? _server;
double _serverSyncProgress = 0.0;
Owner

this doesn't belong here

this doesn't belong here
dan marked this conversation as resolved
@ -0,0 +42,4 @@
notifyListeners();
}
void updateSyncProgressFor(DateTime point) {
Owner

comment this explaining the logic

comment this explaining the logic
dan marked this conversation as resolved
@ -0,0 +46,4 @@
var range = lastPreSyncMessagTime.difference(DateTime.now());
var pointFromStart = lastPreSyncMessagTime.difference(point);
syncProgress = pointFromStart.inSeconds / range.inSeconds * 100;
groups.forEach((g) { g.serverSyncProgress = syncProgress;});
Owner

As above, forcing contacts to have a field to track sync progress isn't great - considering they already have an optional server handle. Groups shouldn't store this information, servers should.

As above, forcing contacts to have a field to track sync progress isn't great - considering they already have an optional server handle. Groups shouldn't store this information, servers should.
dan marked this conversation as resolved
dan added 1 commit 2022-01-27 23:41:32 +00:00
Member
Drone Build Status: success https://build.openprivacy.ca/cwtch.im/cwtch-ui/534
sarah approved these changes 2022-01-28 21:23:14 +00:00
dan added 1 commit 2022-02-02 18:05:41 +00:00
dan merged commit ca03ddbc53 into trunk 2022-02-02 18:05:50 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#340
No description provided.