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

Convert IdentityService to suspend functions #3069

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

Dominaezzz
Copy link
Contributor

Signed-off-by: Dominic Fischer [email protected]

Pull Request Checklist

  • Changes has been tested on an Android device or Android emulator with API 21
  • UI change has been tested on both light and dark themes
  • Pull request is based on the develop branch
  • Pull request updates CHANGES.md
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR.
Just one question about the usage of withContext (but maybe out of scope of this PR)
Benoit

}

return taskExecutor.executorScope.launchToCallback(coroutineDispatchers.main, callback) {
withContext(coroutineDispatchers.main) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this is necessary to keep the withContext() call here (and for other methods too). WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I was thinking about this. We can (and should) drop the withContext here.
To keep things simple I left it in, to mostly preserve previous behaviour.
Once all the callbacks have been converted and everything is consistently marked as suspend, I was planning to review all the uses of withContext and remove the unnecessary ones.
Although....... most of these have been pretty simple so far but I only realized that after like the 9th PR, by which point it was too late 😂.
We can just remove them; I'm at work right now so I can do so in the evening.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the update. But please next time add new commits, because I had to review the whole code again since you did a squash and force push including the previous changes.

@bmarty bmarty merged commit 842a430 into element-hq:develop Mar 30, 2021
@Dominaezzz Dominaezzz deleted the suspend_functions_1 branch March 30, 2021 07:49
@Dominaezzz
Copy link
Contributor Author

Will do that next time. 👍
(Sorry about the other PRs too 😅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants