fix(ffi): add methods to make QR login handlers exit cooperatively#6677
fix(ffi): add methods to make QR login handlers exit cooperatively#6677Johennes wants to merge 11 commits into
Conversation
06d5662 to
6d59114
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6677 +/- ##
==========================================
+ Coverage 89.91% 89.94% +0.03%
==========================================
Files 398 398
Lines 111154 111482 +328
Branches 111154 111482 +328
==========================================
+ Hits 99948 100278 +330
+ Misses 7415 7410 -5
- Partials 3791 3794 +3 ☔ View full report in Codecov by Harness. |
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
6d59114 to
a2f3f61
Compare
Hywan
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I think it makes sense but I've added a couple comments.
Would it be possible to move that inside the matrix_sdk crate? First off, it would allow proper testing, and second, it can be useful for Rust users too. Keep in mind the FFI crate is only about bindings, no logic at all.
…vely Fix doc comments Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
…vely Remove biasing Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
That would be great but I'm not entirely sure how. The problem only exists because of the progress tasks and those only exist in the FFI crate. |
Yes, but there is no interaction between the cancellation and the progress listener. I think it's a safe feature to move into Or, alternatively (I don't want and I don't like this solution but I'm providing an alternative here), add tests in |
…vely Revert back to biased and document why its needed Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Hywan
left a comment
There was a problem hiding this comment.
One feedback unaddressed (about moving it to matrix-sdk).
Yes, apologies. I'm still looking into that. |
|
No problem! |
…vely Move logic into SDK Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
|
Sorry for the long wait. I have moved the logic into the SDK in b731790. This is still missing tests in the granting case and updated changelog entries. But is this what you had in mind? |
|
Looks like it's the right direction. |
…vely Add tests for the grant case Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
…vely Update changelogs Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
…vely Add missing use declarations Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
|
Somehow GitHub seems to have lost your comment about |
…vely Add more missing use declarations Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
…vely Add missing semicolon Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
|
Otherwise, this should finally be ready for review now. |
With my Filament hat on: This add new methods on the QR login handlers to make them exit cooperatively by first dropping the updates task and then returning. We've found this necessary when using the React Native FFI bindings in release builds to prevent crashes when the futures are cancelled.