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

Add default remote keys for all feature flags #1716

Closed
1 task done
bjtitus opened this issue May 6, 2024 · 4 comments · Fixed by #1762
Closed
1 task done

Add default remote keys for all feature flags #1716

bjtitus opened this issue May 6, 2024 · 4 comments · Fixed by #1762
Assignees

Comments

@bjtitus
Copy link
Contributor

bjtitus commented May 6, 2024

Description

Any feature flag we add currently needs a corresponding remoteKey added.

We shouldn't need to do this since any flag should be overridable server side for flexibility.

Step-by-step reproduction instructions

  1. Add a Feature Flag to FeatureFlag.swift
  2. Add an overwritten value to Firebase Remote Config
  3. New value should replace the client-side value

Screenshots or screen recording

No response

Did you search for existing bug reports?

  • I have searched for existing bug reports.

Device, Operating system, and Pocket Casts app version

No response

@leandroalonso
Copy link
Member

@bjtitus I think there's one additional test we should do:

  1. Add a Feature Flag to FeatureFlag.swift
  2. Add an overwritten value to Firebase Remote Config
  3. New value should replace the client-side value
  4. Delete the Firebase Remote Config one
  5. ✅ Local feature flag value should remain the same (we don't want flags to change values when we delete them)

@bjtitus bjtitus self-assigned this May 14, 2024
@bjtitus
Copy link
Contributor Author

bjtitus commented May 23, 2024

✅ Local feature flag value should remain the same

Are you saying we should store the changed Remote Config value instead of reverting to the value in FeatureFlag.default?

Is the idea to cover future flag removal?

I fear this could make it much hard for us to debug issues without knowing which flag values a user should have. As an example, if someone accidentally added a flag and then deleted it, would we be able to determine which value a user should have on their device without needing to fetch logs/data directly from them?

If we do decide to do this, I think it should be done separately from the default values since this would be new functionality on top of just adding a default value for each flag.

@leandroalonso
Copy link
Member

Is the idea to cover future flag removal?

Yes!

My main reasoning is: that if an app is working with a flag set to a certain value, it should not change. Think about this scenario:

  1. The flag test has a default value of true
  2. We configured this flag to be false for versions below 7.60
  3. After some time, we delete flag test
  4. Now, for versions below 7.60 the flag will change to true

I fear this could make it much hard for us to debug issues without knowing which flag values a user should have. As an example, if someone accidentally added a flag and then deleted it, would we be able to determine which value a user should have on their device without needing to fetch logs/data directly from them?

I agree with you but overall in support requests one of the things we always recommend is to be on the latest version — but I also agree that this is an argument that goes both ways.

If we do decide to do this, I think it should be done separately from the default values since this would be new functionality on top of just adding a default value for each flag.

In terms of implementation wouldn't that be just a matter of settings flags values only from the list that is returned from the backend? So in case test flag is not there anymore, we do nothing with it.

@bjtitus
Copy link
Contributor Author

bjtitus commented May 23, 2024

In terms of implementation wouldn't that be just a matter of settings flags values only from the list that is returned from the backend?

Yeah, the implementation isn't too bad, I just wanted to make sure it's easily revertible if we end up with issues. I think having a separate commit is fine: 0f4659e

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