-
Notifications
You must be signed in to change notification settings - Fork 254
Make DatabaseLoginsStorage async
#6791
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
base: main
Are you sure you want to change the base?
Conversation
There hasn't been agreement on a grand vision for async Rust in app-services (mozilla#6549). I think part of the reason is that ADR is discussing too many things. This is my attempt to take a small change from that ADR and see if we agree. This change takes the async wrapping code that's currently in android-components and moves it to our app-services wrapper. This improves the API boundary IMO. The SYNC sync and the credentials management teams are responsible for threading issues. For example, we're the one's thinking through how to avoid blocking too many threads when we're waiting on the primary password dialog. Since we're responsible for threading issues, we should own the code On a practical level: I have some ideas on how to improve our threading strategy and it's simpler to think about those changes if all the code is in one repo. Here's the corresponding android-components change: bendk/firefox@d038ba6 If we agree on this, then I think we can do something similar for iOS. What do others think? Is this a good idea? Do we need/want an ADR for this?
A couple questions . . . what is the SYNC sync? I'm assuming that's us but I just want to make sure I didn't miss a jargon drop. Also, are we responsible for threading issues? I'm going to, perhaps anally, push back a little here. I see that you've converted the Kotlin logins store functions to That aside these changes make sense to me, though I defer to Mark and Sammy as my Android knowledge is meager. |
I think Ben meant to write "sync team" there. So I think I agree with you both - with our "sync team" hat on, I don't think we own the threading model for anything other than our components. But with our "rust components" hat on, I agree that we should have a holistic view and approach to threading so the credential management team and the sync team don't need to think too much about it and would need to try hard to screw things up. Sorry I missed this - I notice it's now over 6 months old - should I look at it in detail? |
Ah yes, the rust components team . . . assuming this is a pattern we'd implement in all of our components and any new components moving forward this makes sense. |
|
Yup, that should read "Sync team". Sorry for the confusion. I'll try to dust this one off and rebase it sometime next week.
Yes I think we would, but we also kind of do now IMO. I just had to fix a deadlock on desktop because of threading issues, specifically weird issues that happen because of the way the main thread is special cased there. It would be great not to have to do this, but my feeling is that we're going to be on the hook one way or another and this is a pro-active step to help that work by marking functions as
Yeah, I'm also concerned about that part -- the iOS side definitely feels riskier. Maybe this could help us standardize how we use
That'd be great, thanks. I am planning to rebase so maybe you want to wait for that. That said, I don't think any of the basic ideas have changed in that time though so maybe you don't need to wait.
This is great point that I need to think about more, but I like your basic setup: We're the rust components team and we should be recommending an approach to threading that helps teams like credential management produce correct code. |
There's definitely some cleanup we could do but I think the iOS team is working on removing |
There hasn't been agreement on a grand vision for async Rust in app-services (#6549). I think part of the reason is that ADR is discussing too many things. This is my attempt to take a small change from that ADR and see if we agree.
This change takes the async wrapping code that's currently in android-components and moves it to our app-services wrapper. This improves the API boundary IMO. The SYNC sync and the credentials management teams are responsible for threading issues. For example, we're the one's thinking through how to avoid blocking too many threads when we're waiting on the primary password dialog. Since we're responsible for threading issues, we should own the code
On a practical level: I have some ideas on how to improve our threading strategy and it's simpler to think about those changes if all the code is in one repo.
Here's the corresponding android-components change: bendk/firefox@d038ba6
If we agree on this, then I think we can do something similar for iOS.
What do others think? Is this a good idea? Do we need/want an ADR for this?
Pull Request checklist
[ci full]to the PR title.