refactor(foundation): decouple up/down commands and suppress unregistered binding noise#1431
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1431 +/- ##
==========================================
+ Coverage 68.28% 68.83% +0.55%
==========================================
Files 357 357
Lines 27682 27685 +3
==========================================
+ Hits 18903 19058 +155
+ Misses 7933 7782 -151
+ Partials 846 845 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
upanddowncommands now receive explicit dependencies instead of the fullApplicationobjectdefaultCommands()consolidates command registration and conditionally includesup/downonly when Storage, View, and Hash are boundMakeX()container methods no longer print to the terminal when a binding is simply unregistered; other errors still logWhy
The
upanddowncommands previously acceptedfoundation.Applicationin their constructors and calledMakeStorage(),MakeView(), andMakeHash()immediately. When those bindings were not registered yet (e.g. duringBoot()), everyMake*call printed a spurious "binding not found" error to the terminal. By injecting the resolved values directly and guarding their inclusion behind nil checks, construction is side-effect free and the commands only appear when their dependencies are actually available.A companion change introduces
BindingNotFoundErrorso thatlogMakeErrorIfNeededcan distinguish a missing optional binding from a genuine resolution failure. Only real errors are printed now.