-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add option to enable the v3 scheduler #12178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this a lot, and I think it's near-perfect, just want a second look at the null handling as commented
// v3 scheduler | ||
@RustCleanup("move this to Reviewing > Scheduling once the new backend is the default") | ||
val v3schedPref = requirePreference<SwitchPreference>(R.string.enable_v3_sched_key).apply { | ||
isChecked = CollectionHelper.isV3Enabled(col!!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be in a withCol { } ? just curious, it's col!! here, but below col? (but then col?.newBackend!! - the null handling just has me a bit worried
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good question and I can't answer for sure. I haven't thought much about withCol, neither I grasp completely where we should use it, but I suppose it's on wherever possible.
I've tried to adress this on the last two commits and I'm gonna ask @dae if they are fine or if he could give me a direction on this
I'm definitely not sure if the runBlockingCatching use was correct, as it is used to configure the UI. Probably not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, all new code committed to the repo would use withCol, and ideally doing so in a launched task, so it doesn't block the UI like runBlockingCatching does. Integrating a launched task into some code paths may be tricky though, and it can require additional changes to avoid breaking unit tests if that path is tested, so it may be worth being pragmatic at the moment - allowing blocking calls if required, and not blocking a PR if there's already a bunch of surrounding code accessing the collection directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, good to know. Used lanchCatchingTask. Thanks!
And override it on CollectionV16.kt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better to me! Thank you
Pull Request template
Purpose / Description
Help people test, and test and test and test and test all night long
Approach
_loadScheduler()
into CollectionHelper.isV3EnabledHow Has This Been Tested?
Checklist
Please, go through these checks before submitting the PR.