From 067027d3762ff867bda49d9e4a17d499f80f539f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 22 Apr 2020 20:54:17 +0200 Subject: [PATCH] note updates --- doc/- sync comes under session | 3 --- doc/impl-thoughts/LOCAL-ECHO-STATE.md | 16 ++++++++++++++++ doc/impl-thoughts/RECONNECTING.md | 7 ++++++- 3 files changed, 22 insertions(+), 4 deletions(-) delete mode 100644 doc/- sync comes under session create mode 100644 doc/impl-thoughts/LOCAL-ECHO-STATE.md diff --git a/doc/- sync comes under session b/doc/- sync comes under session deleted file mode 100644 index 4db2baf1..00000000 --- a/doc/- sync comes under session +++ /dev/null @@ -1,3 +0,0 @@ - - sync comes under session - - sessioncontainer/client orchestrating reconnection - - \ No newline at end of file diff --git a/doc/impl-thoughts/LOCAL-ECHO-STATE.md b/doc/impl-thoughts/LOCAL-ECHO-STATE.md new file mode 100644 index 00000000..4d5a7215 --- /dev/null +++ b/doc/impl-thoughts/LOCAL-ECHO-STATE.md @@ -0,0 +1,16 @@ +# Local echo + +## Remote vs local state for account_data, etc ... + +For things like account data, and other requests that might fail, we could persist what we are sending next to the last remote version we have (with a flag for which one is remote and local, part of the key). E.g. for account data the key would be: [type, localOrRemoteFlag] + +localOrRemoteFlag would be 1 of 3: + - Remote + - (Local)Unsent + - (Local)Sent + +although we only want 1 remote and 1 local value for a given key, perhaps a second field where localOrRemoteFlag is a boolean, and a sent=boolean field as well? We need this to know if we need to retry. + +This will allow resending of these requests if needed. Once the request goes through, we remove the local version. + +then we can also see what the current value is with or without the pending local changes, and we don't have to wait for remote echo... diff --git a/doc/impl-thoughts/RECONNECTING.md b/doc/impl-thoughts/RECONNECTING.md index f8cb02a5..fc7a3b41 100644 --- a/doc/impl-thoughts/RECONNECTING.md +++ b/doc/impl-thoughts/RECONNECTING.md @@ -66,7 +66,12 @@ rooms should report how many messages they have queued up, and each time they se NO: When connected, syncing and not sending anything, just hide the thing for now? although when you send messages it will just pop in and out all the time. - see if it makes sense for SendScheduler to use the same RetryDelay as Reconnector - - finally adjust all file names to their class names? e.g. camel case + - DONE: finally adjust all file names to their class names? e.g. camel case - see if we want more dependency injection - for classes from outside sdk - for internal sdk classes? probably not yet + + + + +thought: do we want to retry a request a couple of times when we can't reach the server before handing it over to the reconnector? Not that some requests may succeed while others may fail, like when matrix.org is really slow, some requests may timeout and others may not. Although starting a service like sync while it is still succeeding should be mostly fine. Perhaps we can pass a canRetry flag to the HomeServerApi that if we get a ConnectionError, we will retry. Only when the flag is not set, we'd call the Reconnector. The downside of this is that if 2 parts are doing requests, 1 retries and 1 does not, and the both requests fail, the other part of the code would still be retrying when the reconnector already kicked in. The HomeServerApi should perhaps tell the retryer if it should give up if a non-retrying request already caused the reconnector to kick in?