Skip to content

feat: add circular dependency detection with PodCycleError#5

Merged
robert-northmind merged 1 commit into
mainfrom
codex/handle-cycles
Feb 5, 2026
Merged

feat: add circular dependency detection with PodCycleError#5
robert-northmind merged 1 commit into
mainfrom
codex/handle-cycles

Conversation

@robert-northmind

Copy link
Copy Markdown
Owner

Summary

  • Add circular dependency detection during provider resolution with descriptive PodCycleError
  • Add optional debugName parameter to Provider for clearer diagnostics in error messages
  • Unnamed providers display as Provider<T> in cycle error chains (e.g., A -> Provider<String> -> C -> A)

Changes

File Description
lib/src/errors.dart New PodCycleError class with cycle chain and human-readable toString
lib/src/provider.dart Add debugName parameter and debugLabel getter
lib/src/pod.dart Track resolution stack to detect cycles during resolve()
lib/dartypod.dart Export new errors.dart
test/pod_test.dart Tests for cycle detection and concurrent async resolves
CHANGELOG.md Document new features under Unreleased

Test plan

  • dart test passes (44 tests)
  • dart analyze --fatal-infos passes
  • dart format applied
  • CHANGELOG updated

Made with Cursor

Detect cycles during provider resolution and throw a descriptive
PodCycleError with the full dependency chain. Providers can now
include an optional debugName for clearer diagnostics; unnamed
providers display as Provider<T> in error messages.

Changes:
- Add PodCycleError with cycle chain and human-readable toString
- Add debugName parameter and debugLabel getter to Provider
- Track resolution stack in Pod to detect cycles
- Add tests for cycle detection and concurrent async resolves

Co-authored-by: Cursor <cursoragent@cursor.com>
@robert-northmind robert-northmind added the enhancement New feature or request label Feb 5, 2026
@robert-northmind
robert-northmind merged commit c08c4da into main Feb 5, 2026
8 checks passed
@robert-northmind
robert-northmind deleted the codex/handle-cycles branch February 5, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant