Skip to content

Replace local SyncTaskRegistry with gto-support-sync library#4447

Merged
frett merged 1 commit into
developfrom
sharedSyncTaskRegistry
Jun 3, 2026
Merged

Replace local SyncTaskRegistry with gto-support-sync library#4447
frett merged 1 commit into
developfrom
sharedSyncTaskRegistry

Conversation

@frett

@frett frett commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Deletes the local SyncTaskRegistry class and migrates all three dashboard presenters (DashboardPresenter, LessonsPresenter, ToolsPresenter) to use rememberSyncTaskRegistry / rememberSyncTask from the gto-support-sync library
  • Updates tests to use the library SyncTaskRegistry directly via putTag() instead of the now-internal extension property, and deletes SyncTaskRegistryTest (covered by the library's own tests)
  • Fixes a pre-existing issue in ToolsPresenter where the sync locale fell back to settings.appLanguage (a one-shot read) — it now uses settings.appLanguageFlow.collectAsState() so locale changes are reflected reactively

Test plan

  • ./gradlew test passes
  • ./gradlew :build-logic:ktlintCheck ktlintCheck passes

🤖 Generated with Claude Code

…tation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@frett frett left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review

Removes the hand-rolled SyncTaskRegistry from :app and replaces it with rememberSyncTaskRegistry / rememberSyncTask from gto-support-sync across all three dashboard presenters. Also fixes a pre-existing bug in ToolsPresenter where the fallback sync locale was a one-shot read instead of a reactive flow.

✅ Looks Good

  • ktlint — passes clean
  • Presenter patternsDashboardPresenter correctly calls syncRegistry.rememberSyncTask { } directly on the returned registry (not via circuitContext.rememberSyncTask { }), which avoids the DisposableEffect timing gap where the context tag isn't set until after first composition
  • LessonsPresenter / ToolsPresentercircuitContext.rememberSyncTask(locale) { } is the right child-presenter pattern; behavior is equivalent to the old DisposableEffect registration
  • Test updatesputTag(syncTaskRegistry) correctly replaces the internal extension setter for cross-module test setup; circuitContext.tag<SyncTaskRegistry>() correctly replaces the internal getter in DashboardPresenterTest
  • SyncTaskRegistryTest deletion — correct; the library's own tests cover this behavior
  • appLanguageFlow fixcollectAsState() on the StateFlow provides a stable initial value immediately; recomposition on locale change is intentional and correct
  • Initialization order in testssyncTaskRegistry is declared before circuitContext in both test classes, so property initialization is safe

🤖 Posted by Claude Code

@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 52.26%. Comparing base (4cbc5a3) to head (723a001).

Files with missing lines Patch % Lines
...rg/cru/godtools/ui/dashboard/DashboardPresenter.kt 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4447      +/-   ##
===========================================
- Coverage    52.34%   52.26%   -0.09%     
===========================================
  Files          457      456       -1     
  Lines        12228    12202      -26     
  Branches      2122     2119       -3     
===========================================
- Hits          6401     6377      -24     
  Misses        5202     5202              
+ Partials       625      623       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frett frett merged commit cb4a1b1 into develop Jun 3, 2026
20 of 21 checks passed
@frett frett deleted the sharedSyncTaskRegistry branch June 3, 2026 03:28
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.

1 participant