a bunch of cache logic fixes and futher support for reconnect on android #431
No reviewers
Labels
No Label
android
arch
backlog
blocked-on-external
bug
bugbash
component/bindings
component/bine
component/connectivity
component/cwtch
component/tapir
component/ui
cwtch-1.14
cwtch-1.15
cwtch-beta-1.1
cwtch-beta-1.10
cwtch-beta-1.11
cwtch-beta-1.12
cwtch-beta-1.13
cwtch-beta-1.2
cwtch-beta-1.3
cwtch-beta-1.4
cwtch-beta-1.5
cwtch-beta-1.5.x
cwtch-beta-1.6
cwtch-beta-1.7
cwtch-beta-1.8
cwtch-beta-1.9
design
duplicate
enhancement
flutter
funding-needed
help wanted
hybrid-groups
in-nightly
in-progress
invalid
ios
linux
mac
need-replication-or-investigation
ops
packaging
post-stable
question
questionable
requires-more-effort-than-we-can-spare
rust
scheduled
stable-blocker
tails
testing-needed
tests
tor
waiting-on-fix-confirmation
waiting-on-new-flutter-feature
whonix
windows
wontfix
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cwtch.im/cwtch-ui#431
Loading…
Reference in New Issue
No description provided.
Delete Branch "cachefixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
needs cwtch.im/libcwtch-go#85
WIP a bunch of cache logic fixes and futher support for reconnect on androidto a bunch of cache logic fixes and futher support for reconnect on androidDrone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch-ui/706
@ -97,0 +101,4 @@
// if we find the last seen ID, the diff of unread count is what's unsynced
for(var i = 0; i < (count+1) && i < cacheByIndex.length; i++) {
if (this.cacheByIndex[i].messageId == lastSeenId) {
// we have
we have....
@ -124,6 +149,9 @@ class MessageCache extends ChangeNotifier {
void lockIndexes(int start, int end) {
for (var i = start; i < end; i++) {
this.cacheByIndex.insert(i, LocalIndexMessage(null, isLoading: true));
if (this._indexUnsynced > 0) {
document why this is here
@ -177,6 +177,13 @@ class ProfileInfoState extends ChangeNotifier {
profileContact.status = contact["status"];
profileContact.totalMessages = contact["numMessages"];
profileContact.unreadMessages = contact["numUnread"];
// we only count up to 100 unread messages, if more than that we can't accuratly resync message cache, just reset
accurately
also..where do we document the
100
unread messages limitation?https://git.openprivacy.ca/cwtch.im/libcwtch-go/src/branch/trunk/utils/eventHandler.go#L210
added more comments, named consts
@ -178,2 +178,4 @@
profileContact.totalMessages = contact["numMessages"];
profileContact.unreadMessages = contact["numUnread"];
// we only count up to 100 unread messages, if more than that we can't accuratly resync message cache, just reset
if (contact["numUnread"] > 100 || (contact["numUnread"] > 0 && contact["lastSeenMessageId"] == -1)) {
>= 100
?100 should be ok, it's fetch
this is just a work saver, if it passes through and ultimatly fails to find a lastSeenIdMatch it'll also reset
@ -180,0 +181,4 @@
if (contact["numUnread"] > 100 || (contact["numUnread"] > 0 && contact["lastSeenMessageId"] == -1)) {
profileContact.messageCache.resetIndexCache();
} else if (contact["numUnread"] > 0) {
print("contact ${contact["name"]} with unread ${contact["numUnread"]} so addFrontIndexGap");
DebugLog
ah deleted, left over debug code
d85b168c72
to4bd92d854f
Drone Build Status: success
https://build.openprivacy.ca/cwtch.im/cwtch-ui/709