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

Empty Arrays Returned for Segments and Variants on GET flags endpoint #199

Closed
corytak opened this issue Dec 24, 2018 · 2 comments · Fixed by #200
Closed

Empty Arrays Returned for Segments and Variants on GET flags endpoint #199

corytak opened this issue Dec 24, 2018 · 2 comments · Fixed by #200

Comments

@corytak
Copy link

corytak commented Dec 24, 2018

Expected Behavior

Calling the GET /flags endpoint would return a collection of segments and variants related to each flag

Current Behavior

GET /flags endpoints returns empty arrays for segments and variants regardless of whether or not they're present

Possible Solution

If there's concern about the size of the response, could potentially have a summary flag as a query parameter that returns a list of flags without all of their child component details

Steps to Reproduce (for bugs)

  1. Navigate to Live Demo Site
  2. Open Dev Tools in Chrome and navigate to Network tab
  3. Choose flags request and preview response
  4. Note that segments and variants are empty

image

Context

I'm attempting to migrate feature flags and their state from lower environments to higher environments in a code first fashion. Checking the state of existing flags, variants, and segments would make this process easier. As a work around, I can GET /flags and then GET the segments for each flag individually, but would prefer to be able to make one request up front.

Your Environment

  • Version used (flagr version): 1.0.12
  • Server type and version:
  • Operating System and version (uname -a):
  • Link to your project: Private Repo
@zhouzhuojie
Copy link
Collaborator

Thanks for reporting, I didn't include the preloaded segments and variants to save some time when rendering the frontpage list.

What do you think of adding a parameter like GET /flags?preload=true to get all the segments and variants, while at the same time, keep the current behavior of GET /flags?

@corytak
Copy link
Author

corytak commented Dec 27, 2018

I think that sounds like a great plan

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 a pull request may close this issue.

2 participants