Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection (and cross-connection room) management #63

Open
KitsuneRal opened this issue May 17, 2017 · 0 comments
Open

Connection (and cross-connection room) management #63

KitsuneRal opened this issue May 17, 2017 · 0 comments
Labels
enhancement A feature or change request for the library

Comments

@KitsuneRal
Copy link
Member

Now that Quaternion gains multiple accounts support, a need arises to have a ConnectionManager singleton that would create, keep, and delete Connection objects. This same singleton would own a NetworkAccessManager instance; but more importantly, it could notify clients what happens to connections without re-connecting to a new object every time a new Connection is made.

In addition, here come a few words from quotient-im/Quaternion#155:

  • There's a dubious distinction between loginError and loggedOut signals in Connection. In reality loginError is emitted in cases where something terribly bad goes on with user's access - such as AuthenticationRequired response returned from a /sync REST call. I suppose we have to merge these into one signal.
  • A logged out connection lives for a very short time and its status in general is unclear. In theory the libqmatrixclient code could support relogin in such case (and there's a reconnect() method that does exactly that) - however, Quaternion simply disposes of logged out connections as soon as it detects them. Given that logout (as well as login error, see the previous question) basically mean that the password is not (or no more) effectual, seems that this is the only reasonable way to deal with such connections. If that's the case, emitting Connection::loggedOut may be followed by deleteLater() right in the Connection code.
  • There's quite a bit of connection orchestration code that now resides in MainWindow but is very well worth putting in the library. There's a rationale for a QMatrixClient::ConnectionManager class. A similar RoomManager class would also be very nice to have and could serve as a library base for the room list model, or even the model itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for the library
Projects
Status: Version 1.0
Development

No branches or pull requests

1 participant