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

Prepare libQuotient for operating without being able to reach the server #777

Merged
merged 8 commits into from
Aug 23, 2024

Conversation

TobiasFella
Copy link
Member

No description provided.

@TobiasFella TobiasFella requested a review from KitsuneRal July 17, 2024 21:04
Copy link

@TobiasFella
Copy link
Member Author

Great job, tobias, create a merge request that does everything except the thing it says it does 🤦‍♂️

@TobiasFella TobiasFella force-pushed the tobias/no-eventloop branch from 479a8df to b8e932d Compare July 18, 2024 16:59
@TobiasFella TobiasFella changed the title Get rid of nested QEventLoop when loading pickling key Prepare libQuotient for operating without being able to reach the server Jul 18, 2024
@TobiasFella
Copy link
Member Author

Slightly hijacked the merge request to do the rest of what I want to do; see individual commits for details

@KitsuneRal KitsuneRal added the enhancement A feature or change request for the library label Jul 19, 2024
Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

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

Thanks for reaching this corner - generally it looks good but I'd prefer futures to callbacks these days. It might be just me, so I'm open to discuss the benefits of either approach.

Quotient/connectionencryptiondata_p.cpp Outdated Show resolved Hide resolved
Quotient/connectionencryptiondata_p.cpp Outdated Show resolved Hide resolved
Quotient/connection.cpp Outdated Show resolved Hide resolved
Quotient/connection.cpp Outdated Show resolved Hide resolved
TobiasFella and others added 6 commits August 14, 2024 23:09
This is important for clients to know the point from which it is safe to load state without
risking problems due to the e2ee machinery not being ready yet.
… before connecting to the server

This allows libQuotient-based clients to operate with the cached state (and in the future, room events)
when there is no network connection. It's losing the check whether userid and deviceid correspond to the given token,
but I don't see a strong need for that.
Linux pipelines fail mysteriously since the rewrite, with the keychain
job getting deleted before yielding the result - maybe the newest
Qt Keychain would be better?
@KitsuneRal KitsuneRal force-pushed the tobias/no-eventloop branch from 61fe407 to 45adeee Compare August 23, 2024 18:04
Qt 6.4 doesn't handle QFutures with move-only results well.
The workaround for now is to pass the reference to the ultimate
move-only result (i.e. Connection::Private::encryptionData) into
all the continuations as a captured variable. Once we require
at least Qt 6.5 this workaround can be removed and normal QFuture
logic used to pass defered results around.
@KitsuneRal KitsuneRal force-pushed the tobias/no-eventloop branch from 45adeee to e447f41 Compare August 23, 2024 19:49
@KitsuneRal
Copy link
Member

The last round and then merge.

@KitsuneRal KitsuneRal merged commit c09f36d into dev Aug 23, 2024
6 checks passed
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 - Done
Development

Successfully merging this pull request may close these issues.

2 participants