Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

TestData FlagBuilder rules seem to be erased when toggling a flag off and on again #220

Closed
ashoofly opened this issue Nov 25, 2020 · 3 comments
Assignees

Comments

@ashoofly
Copy link

ashoofly commented Nov 25, 2020

Is this a support request?
Yes and no? I filed a support ticket since it affects our work but source seems to be SDK itself.

Describe the bug
The TestData source does not seem to persist rules after toggling a flag off and then back on again.

To reproduce
Run these added unit tests: https://github.com/ashoofly/java-server-sdk/pull/1/files.
rulesPersistAfterTogglingFlagOffAndOn() should fail.
For comparison, targetsPersistAfterTogglingFlagOffAndOn() succeeds.

Expected behavior
Existing rules should remain in place after a flag is toggled back on.

Logs

SDK version
5.2.0

Language version, developer tools
jdk1.8.0_121

OS/platform
Mac OSX Catalina

Additional context
I've also noticed during debugging that the rules field in the TestData.FlagBuilder is always null.

@ashoofly ashoofly changed the title TestData.java bug TestData FlagBuilder rules seem to be erased when toggling a flag off and on again Nov 25, 2020
@bwoskow-ld
Copy link
Member

Hi @ashoofly ,

Thanks for letting us know! Indeed, targeting rules aren't copied to new FlagBuilder instances which are created when the test data is updated. This is a bug and I have a fix for it under review internally.

Cheers,
Ben

@bwoskow-ld bwoskow-ld self-assigned this Nov 30, 2020
LaunchDarklyCI pushed a commit that referenced this issue Dec 1, 2020
(5.0) remove a few more unnecessary Guava usages
@bwoskow-ld
Copy link
Member

Hi @ashoofly,

We've released 5.2.1 with a fix.

Cheers,
Ben

@ashoofly
Copy link
Author

ashoofly commented Dec 2, 2020

Thank you, @bwoskow-ld!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants