Skip to content

refactor(providers): break remaining transitive app_providers dependency cycle#4720

Merged
NotThatKindOfDrLiz merged 2 commits into
mainfrom
refactor/4554-break-app-providers-cycle
May 25, 2026
Merged

refactor(providers): break remaining transitive app_providers dependency cycle#4720
NotThatKindOfDrLiz merged 2 commits into
mainfrom
refactor/4554-break-app-providers-cycle

Conversation

@realmeylisdev
Copy link
Copy Markdown
Contributor

@realmeylisdev realmeylisdev commented May 25, 2026

Description

Follow-up cleanup to the #4506 split. This PR removes the remaining transitive app_providers.dart dependency cycle inside mobile/lib/providers/ by relocating createBlockedAuthorFilter into moderation_providers.dart, reducing app_providers.dart to a pure compatibility barrel, and redirecting provider-layer imports to direct sibling leaf modules.

Result: no file under lib/providers/ imports app_providers.dart anymore, so the aggregator no longer participates in the cycle. External consumers still resolve the same symbols through the compatibility exports, so behavior remains unchanged.

Related Issue: Refs #4554

Out of Scope

  • Migrating screen/widget/router consumers off app_providers.dart
  • Broader base-layer extraction to force a strict acyclic graph

Verification

  • flutter analyze lib test integration_test
  • flutter test test/providers
  • dart run build_runner build --delete-conflicting-outputs produced no generated diff

Type of Change

  • Code refactor

@github-actions

This comment has been minimized.

…viders a pure barrel

Move createBlockedAuthorFilter into moderation_providers.dart — its only
dependencies (contentBlocklistRepositoryProvider, contentPolicyEngineProvider)
already live there — and reduce app_providers.dart to export-only. This
removes the last symbol that forced split leaf modules to import the
aggregator back, so the aggregator no longer participates in a dependency
cycle.

moderation_providers itself now imports auth/repository directly instead of
the aggregator (dropping the feedAspectRatio hide that only existed to avoid
the barrel re-export collision).

Refs #4554.
…barrel

Replace the app_providers.dart import with direct sibling-leaf imports across
the remaining 30 provider modules, matching the pattern already used by
social_providers/upload_media_providers. This breaks the transitive
aggregator -> (export) leaf -> (import) aggregator cycle that the #4506 split
left behind: no file under lib/providers/ imports the aggregator anymore.

The ~130 screen/widget/router consumers intentionally stay on the barrel
re-export — that is the separate #4339 compatibility-barrel removal. Pure
import-path change; no runtime behavior change and generated files unaffected.

Closes #4554.
@realmeylisdev realmeylisdev force-pushed the refactor/4554-break-app-providers-cycle branch from a3d7b4a to 635d654 Compare May 25, 2026 14:22
@github-actions
Copy link
Copy Markdown

Mobile PR Preview

Preview refreshed for 635d654

Last refresh: 635d654 at 2026-05-25 14:25:58 UTC (preview run)

Property Value
Preview URL https://33f9ed0e.openvine-app.pages.dev
Pages project openvine-app
Preview branch pr-4720
PR branch refactor/4554-break-app-providers-cycle
Commit 635d654

Copy link
Copy Markdown
Member

@NotThatKindOfDrLiz NotThatKindOfDrLiz left a comment

Choose a reason for hiding this comment

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

Reviewed locally. Import rewiring and helper relocation are safe; no findings.

@NotThatKindOfDrLiz NotThatKindOfDrLiz merged commit 9e21aed into main May 25, 2026
11 checks passed
@NotThatKindOfDrLiz NotThatKindOfDrLiz deleted the refactor/4554-break-app-providers-cycle branch May 25, 2026 19:42
@github-actions github-actions Bot added needs-issue PR needs a linked tracking issue and removed needs-issue PR needs a linked tracking issue labels May 25, 2026
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