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

Apply proper RAII to Connection #439

Open
KitsuneRal opened this issue Jan 8, 2021 · 2 comments
Open

Apply proper RAII to Connection #439

KitsuneRal opened this issue Jan 8, 2021 · 2 comments
Assignees
Labels
enhancement A feature or change request for the library

Comments

@KitsuneRal
Copy link
Member

This is a very bad idea generally, and the current code will leave quite a few things on the floor if setHomeserver() gets called while jobs fly over. And there's no real case for it either; so just forbid it by design. Ideally, the whole server resolution/setting could be a couple of static factories so that Connection would always be created with a sane homeserver set up; but that contradicts to the currently accustomed usage of Connection as a QML component. Maybe when we get a ConnectionManager singleton in Quotient it will be possible to shape the library API in a better way.

@KitsuneRal KitsuneRal added this to Version 0.7 - To Do in libQuotient 1 May 15, 2021
@KitsuneRal KitsuneRal added the enhancement A feature or change request for the library label May 15, 2021
@KitsuneRal KitsuneRal moved this from Version 0.7 - To Do to Version 0.8 in libQuotient 1 Apr 25, 2023
@KitsuneRal
Copy link
Member Author

We have AccountRegistry now, that is as good a factory for Connections as we can get. Getting a Connection object from it instead of creating via new doesn't seem to contradict any code in NeoChat or Quaternion.

@KitsuneRal KitsuneRal self-assigned this May 29, 2023
@KitsuneRal KitsuneRal moved this from 0.8 - To Do to In work in libQuotient 1 May 29, 2023
@KitsuneRal KitsuneRal moved this from In work to 0.8 - To Do in libQuotient 1 Jun 3, 2023
@KitsuneRal KitsuneRal changed the title Officially disallow changing the homeserver on a logged in Connection Apply proper RAII to Connection Apr 4, 2024
@KitsuneRal
Copy link
Member Author

This issue is renamed to reflect that it's not just the homeserver but basically the whole login session identity that has to be preserved within a given Connection object. All pre-login things have to be treated separately, either from AccountRegistry or by a separate PreConnection kind of class with very limited number of operations available.

@KitsuneRal KitsuneRal moved this from 0.8 - To Do to 0.9 - To Do in libQuotient 1 Apr 4, 2024
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: 0.9 - To Do
libQuotient 1
  
0.9 - To Do
Development

No branches or pull requests

1 participant