Flagsmith / flagsmith

Open Source Feature Flagging and Remote Config Service. Host on-prem or use our hosted version at https://flagsmith.com/
https://flagsmith.com/
BSD 3-Clause "New" or "Revised" License
4.76k stars 363 forks source link

List of features associated with a segment shows 1 feature per version #4072

Open rolodato opened 3 months ago

rolodato commented 3 months ago

How are you running Flagsmith

Describe the bug

On an environment with feature versioning enabled, the Features tab for a given Segment shows 1 feature per version for that feature, instead of just the latest version.

Additionally, when editing a segment and browsing to the features tab, this UI makes at least 1 request per feature which can be borderline unusable on high-latency connections and/or when having a large amount of features associated with a single segment. See video below.

High-latency connections are common for anyone far away from London in SaaS, or Enterprise customers requiring slow VPNs to access their self-hosted Flagsmith instances.

Steps To Reproduce

  1. Create a feature in an environment with feature versioning enabled
  2. Create a segment override for that feature
  3. Save a new version for that feature
  4. Browse to the segment with the override, and click on the Feature tab

The feature will be shown twice - one per version. Each version will load individually, causing jank and layout shift as each request completes.

Expected behavior

Only the latest version for each feature should be shown in the Features tab when viewing a segment.

If feasible, loading the list of features associated for a feature should not cause layout shift or show partially complete data.

Screenshots

image

https://github.com/Flagsmith/flagsmith/assets/829698/a53b08df-5d09-4677-8431-5863c8dbebdd

matthewelwell commented 3 months ago

@rolodato I'm not sure, but I think there was also an issue here with regards to versioning. It may have been the case that old versions of segment overrides were also being shown in the list. Are you able to test this and confirm please?

rolodato commented 3 months ago

I honestly can't remember either but I've reached out to the customer to get more details.

rolodato commented 3 months ago

Updated title and description to show the actual problem (one feature per version shown in the list of features associated with a segment).