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

Feature Flags on Organizations shows name but searches on ID #26825

Closed
darkopia opened this issue Dec 11, 2024 · 4 comments · Fixed by #27577
Closed

Feature Flags on Organizations shows name but searches on ID #26825

darkopia opened this issue Dec 11, 2024 · 4 comments · Fixed by #27577
Assignees
Labels
bug Something isn't working right feature/feature-flags Feature Tag: Feature flags team/feature-flags

Comments

@darkopia
Copy link

Bug Description

Bug description

When adding a feature flag for an organization, the organization's filter shows the name of the org but searches on the ID.
You can use the actual name field but the behaviour is slightly confusing

If you are on PostHog Cloud it would be really valuable if you can share any links where the problem occurs. This speeds up our ability to troubleshoot tremendously.

How to reproduce

  1. Create a feature flag targetting organizations
    2.Search the organization by name, nothing returns
  2. Look at the organization filter and the names are shown but the search actually needs an ID.

Additional context

Debug info

No response

@darkopia darkopia added bug Something isn't working right feature/feature-flags Feature Tag: Feature flags labels Dec 11, 2024
@dmarticus
Copy link
Contributor

@darkopia is this still an issue? Or can you provide more details about it? AFAICT this isn't a problem in our app, but maybe I'm misunderstanding what the issue is. Here's a loom of me trying to reproduce it: https://www.loom.com/share/a50d1b27148443d39d272446645fb317

@darkopia
Copy link
Author

Not my finest work on a bug, this is what I should have included:
https://posthoghelp.zendesk.com/agent/tickets/21766

20250114-1800-14.2355059.mp4

in that search, for all other properties you are searching by what is visible, same across all filters actually but there is a company's or orgs or whatever the group is tab that I would expect to be able to search, but I actually need to search by the group ID not the names I can see in the company's tab in that video example.

@dmarticus
Copy link
Contributor

@haacked Ben updated this issue, and now it makes sense! Feel free to take a crack at it as part of your onboarding work :)

@haacked haacked self-assigned this Jan 15, 2025
@haacked
Copy link
Contributor

haacked commented Jan 15, 2025

Ok, I think I understand the issue. I'll write some notes for my own edification here.

So when we're creating a condition and we click the "Match by" button to select a group type (such as company or organization), we get the following pop-up UI.

Image

This gives you a set of group properties you can match with.

However, there's also the search box above the group properties which looks to be a default search. Right now, it searches on the group key.

Image

When you select the group, it then creates a filter on the group key.

Image

What we probably want to happen is for that search to filter on name, but the result should still be a group_key filter. In other words, in that search box, instead of typing 2 I should be able to type Hed and the fuzzy filter will give me a list of "suggested values". When I pick one, it should still be a group_key filter.

Potential approach

Right now, when you start typing in that search box, it's making requests to:

http://localhost:8010/api/environments/1/groups/?group_type_index=4&group_key={searchField}&limit=100&offset=0

haacked added a commit that referenced this issue Jan 16, 2025
The default `searchAlias` is `search`. This is the search query parameter
we want as it searches orgs by name as opposed to their group_key.

Fixes #26825
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right feature/feature-flags Feature Tag: Feature flags team/feature-flags
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants