Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Conversation

@ara4n
Copy link
Member

@ara4n ara4n commented Feb 21, 2017

This adds a 5 minute auth cache to speed up the process of deleting
old devices. It has the following nastinesses (mainly due to being
written on a flight whilst juggling kids):

  • the auth cache is done as context attached to MatrixChat.
    one could argue that it should be per-client instead, but we don't
    yet have multiple clients.
  • the auth cache is only maintained currently in DevicesPanelEntry
    (i.e. set & invalidated). One could argue that it might be better
    maintained in InteractiveAuth.js or a dedicated cache object
    abstraction, but given the only use I can think of is when managing
    devices, perhaps this is good enough for now.
This adds a 5 minute auth cache to speed up the process of deleting old devices. It has the following nastinesses (mainly due to being written on a flight whilst juggling kids): * the auth cache is done as context attached to MatrixChat. one could argue that it should be per-client instead, but we don't yet have multiple clients. * the auth cache is only maintained currently in DevicesPanelEntry (i.e. set & invalidated). One could argue that it might be better maintained in InteractiveAuth.js or a dedicated cache object abstraction, but given the only use I can think of is when managing devices, perhaps this is good enough for now.
@ara4n
Copy link
Member Author

ara4n commented Feb 21, 2017

@richvdh
Copy link
Member

richvdh commented Feb 21, 2017

the auth cache is done as context attached to MatrixChat.
one could argue that it should be per-client instead, but we don't
yet have multiple clients.

you could attach it to the LoggedInView (?) instead, which would solve that problem, as well as the one of secretly persisting your auth credentials over a logout/login cycle?

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks plausible otherwise

import MatrixClientPeg from '../../../MatrixClientPeg';
import Modal from '../../../Modal';
import DateUtils from '../../../DateUtils';
import utils from 'matrix-js-sdk/lib/utils';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still redundant

@richvdh
Copy link
Member

richvdh commented Feb 21, 2017

in fact this seems quite a nice solution!

@ara4n
Copy link
Member Author

ara4n commented Feb 21, 2017

I have moved the cache to LoggedInView to fix the stupid "persist over logout" problem; thanks.

However, i don't think this fixes support for multiple clients in future, given i'd assume that we'd implement multiple clients similar to how Console/iOS and Android did it: i.e. mux all the rooms together into a single UI (perhaps tagged into separate groups per account). So we'd definitely need to somehow anchor the cache to MatrixClient when we get there - perhaps even pushing it into js-sdk for simplicity. I don't think that should block this iteration though.

@richvdh ptal

@richvdh
Copy link
Member

richvdh commented Feb 21, 2017

However, i don't think this fixes support for multiple clients in future,

sorry, I didn't mean to imply it would. It just felt like a more natural place to anchor it.

import MatrixClientPeg from '../../../MatrixClientPeg';
import Modal from '../../../Modal';
import DateUtils from '../../../DateUtils';
import utils from 'matrix-js-sdk/lib/utils';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still redundant

@richvdh richvdh assigned ara4n and unassigned richvdh Feb 21, 2017
@ara4n ara4n merged commit 454dc8e into develop Feb 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants