Skip to content
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

Ensure all empty arrays return [] instead of null #4741

Closed
4 tasks
fedekunze opened this issue Jul 19, 2019 · 4 comments
Closed
4 tasks

Ensure all empty arrays return [] instead of null #4741

fedekunze opened this issue Jul 19, 2019 · 4 comments
Labels
C:CLI good first issue T: Dev UX UX for SDK developers (i.e. how to call our code)
Milestone

Comments

@fedekunze
Copy link
Collaborator

fedekunze commented Jul 19, 2019

Summary

Querying empty objects sometimes return null instead of the expected [].

Problem Definition

This seems to be a recurrent problem for our users as there are quite some issues regarding this: #4276, #4693, #3705, #4259, etc.

Proposal

Create a util function for arrays to always return [] when empty


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@fedekunze fedekunze added the T: Dev UX UX for SDK developers (i.e. how to call our code) label Jul 19, 2019
@fedekunze fedekunze added this to the v0.37.0 milestone Jul 19, 2019
@RiccardoM
Copy link
Contributor

@alexanderbez @fedekunze Hey guys I could implement this. What are your thoughts on how to go for it? Like a simple util function and call it where needed?

@alexanderbez
Copy link
Contributor

@RiccardoM at first thought, the way to approach this is to actually go through each querier method and wherever we return an error, check if the result is nil and return an empty array/slice instead.

@tnachen
Copy link
Contributor

tnachen commented Aug 28, 2019

@RiccardoM are you still planning to work on this?

@RiccardoM
Copy link
Contributor

@tnachen yup, but wanted to wait for additional thought before starting the implementation. Also, I wanted to close #4922 before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:CLI good first issue T: Dev UX UX for SDK developers (i.e. how to call our code)
Projects
None yet
Development

No branches or pull requests

5 participants