- 
                Notifications
    
You must be signed in to change notification settings  - Fork 121
 
Remove bail out behavior if one of the entrypoints does not exist #1165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Remove bail out behavior if one of the entrypoints does not exist #1165
Conversation
4b837ec    to
    52e8bb7      
    Compare
  
    
          Codecov ReportAll modified and coverable lines are covered by tests ✅ 
 Additional details and impacted files@@           Coverage Diff            @@
##           develop    #1165   +/-   ##
========================================
  Coverage    91.05%   91.05%           
========================================
  Files           42       42           
  Lines         2593     2593           
  Branches       752      752           
========================================
  Hits          2361     2361           
  Misses         232      232           
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
| 
           Agree that this is an unexpected behavior but I would rather like to bail out early with an error than executing an invalid (with missing items) run.  | 
    
| 
           @codenirvana , I'm totally fine to throw an error. Thank you for response 🙏🏼 I ll modify the code right in the current PR.  | 
    
52e8bb7    to
    9450484      
    Compare
  
    | 
           @codenirvana , cool. I ll use it. Thank you. Any other comments on code?  | 
    
9450484    to
    98fb5b2      
    Compare
  
    For lookupStrategy "multipleIdOrName", we should bail out wit an error if one of the provided entrypoints does not exist.
98fb5b2    to
    dd22b7d      
    Compare
  
    
If one of the provided entry points is invalid(probably it does exist), then we SHOULDN'T bail out.
Why? Because this is completely surprising behavior for API.
If I have a list of valid entry points(at least I think so, in reality just one of them can be invalid. Mb typo or anything else, whatever). Then I try to run them, I'll get nothing in result. Exactly nothing. Not the error, just success saying nothing was run.
What am I supposed to think of? I see my correct entry points and they're not run. This is so confusing.
The predictable behavior in that case would be throw an error, saying one of your entry points does not exist. Or just ignore the invalid entry points. The correct choice depends on the executed operation. If it's Get(means result should be returned), then error is more natural. If it's Find(like searching for something), then ignoring of non-existent entry points is totally fine.
Since in our case we got a look up(lookupByMultipleIdOrName), then ignoring is our choice.
Btw making some warning about the invalid entry points would be great, do we have a logger or anything like this?