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

With ExpressionFlipStrategy conflict with AND and & in UI and Store #529

Open
vmartowicz opened this issue Oct 4, 2021 · 2 comments
Open
Labels

Comments

@vmartowicz
Copy link

Hi,
As mentioned in ##237 we have the same problem

see the source code 'org.ff4j.utils.MappingUtil'

public static final Map<String, String> toMap(String strParam) {
LinkedHashMap<String, String> parameters = new LinkedHashMap<String, String>();
if (strParam != null) {
//this line****************************
String[] chunks = strParam.split("" + SEPARATOR);
for (String chunk : chunks) {
int idxEqual = chunk.indexOf("=");
if (idxEqual > 0 && idxEqual < chunk.length()) {
String paramName = chunk.substring(0, idxEqual);
String paramValue = chunk.substring(idxEqual + 1);
parameters.put(paramName, paramValue);
}
}

We use :

  • ff4j 1.8.11
  • Mongo DB v3.5.5

The problem is not present with InMemoryFeatureStore because this implementation does not use MappingUtil.toMap.
The data is correctly stored but not read with MongoFeatureStore. The mapper gives 'dummy ' instead of 'dummy & foo'.

If we use AND as workaround, it is not working because ExpressionParser uses the constant AND declered as '&' and not 'AND' (String value).

For instance the expression dummy AND foo is not interpreted as feature 'dummy' AND feature 'foo' but only feature 'dummyANDfoo' which does not exist in this case.

@bbednarek
Copy link

It doesn't work with database implementation either

@vmartowicz
Copy link
Author

vmartowicz commented Jun 28, 2022

@bbednarek I confirm
@clun I'm unable to use ExpressionFlipStrategy with physical Database (mongo or PG ) with condition 'AND'.

@clun clun changed the title & in ExpressionFlipStrategy is not interpreted correctly with MongoDB implementation With ExpressionFlipStrategy conflict with AND and & in UI and Store Dec 19, 2022
@clun clun added the bug label Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants