Skip to content

all: smoother dispatcher provider injecting (fixes #11707)#11632

Merged
dogi merged 4 commits intomasterfrom
harden-observer-lifecycle-dispatcher-injection-16271139669240749116
Mar 4, 2026
Merged

all: smoother dispatcher provider injecting (fixes #11707)#11632
dogi merged 4 commits intomasterfrom
harden-observer-lifecycle-dispatcher-injection-16271139669240749116

Conversation

@dogi
Copy link
Member

@dogi dogi commented Mar 2, 2026

This PR implements several code quality and stability improvements across the project:

  • Replaces GlobalScope usage with an owner-managed @ApplicationScope in the SubmissionUploadExecutor.
  • Introduces a DispatcherProvider interface (with DefaultDispatcherProvider) for injecting coroutine dispatchers into ViewModels (DashboardViewModel, TeamViewModel, etc.), improving testability and removing hardcoded Dispatchers.IO calls.
  • Adds a small .debounce(300) guardrail to the RealtimeSyncHelper to throttle consecutive data updates and reduce UI stuttering.

PR created automatically by Jules for task 16271139669240749116 started by @dogi

1.  Replaced `GlobalScope` semantics with the injected `ApplicationScope` in `SubmissionUploadExecutor` and corrected comments in `UserInformationFragment` where it's used.
2.  Created `DispatcherProvider` and implemented `DefaultDispatcherProvider` and `DispatcherModule` to handle injecting dispatchers into ViewModels via Hilt. Updated `DashboardViewModel`, `FeedbackDetailViewModel`, `RequestsViewModel`, `TeamViewModel`, and `SubmissionViewModel` to use the injected dispatchers. Updated `SubmissionUploadExecutor` to use injected dispatcher as well.
3.  Added a `.debounce(300)` guardrail to the `RealtimeSyncHelper` class (in `RealtimeSyncMixin.kt`) to throttle realtime refresh updates without changing feature behavior.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@dogi dogi added the triage Further information is requested label Mar 2, 2026
@dogi dogi changed the title Harden observer/listener lifecycle contracts and dispatcher injection all: smoother dispatcher injecting (fixes #11707) Mar 4, 2026
@dogi dogi changed the title all: smoother dispatcher injecting (fixes #11707) all: smoother dispatcher provider injecting (fixes #11707) Mar 4, 2026
@dogi dogi merged commit ba4c4b0 into master Mar 4, 2026
3 checks passed
@Okuro3499 Okuro3499 deleted the harden-observer-lifecycle-dispatcher-injection-16271139669240749116 branch March 5, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge triage Further information is requested ⭐⭐⭐.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants