MatrixClient object that gets created stores data in memory instead of storing it to disk, etc. etc. When repeatedly connection you end up with multiple "devices" connected to your Matrix account, additionally I believe this is what causes the full history to be downloaded each connection.
createClient docs show how an options object can be passed in to configure the
store. I think we want to use the
IndexDBStore instead, which uses
IndexedDB under the hood.