Skip to content

Test the targeting cache round trip through real SharedPreferences - #59

Merged
jrosendahl-opt merged 1 commit into
masterfrom
test/targeting-cache-roundtrip
Nov 11, 2026
Merged

jrosendahl-opt merged 1 commit into
masterfrom
test/targeting-cache-roundtrip

Conversation

@jrosendahl-opt

@jrosendahl-opt jrosendahl-opt commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

LocalStorageTest mocks SharedPreferences and JSONObject, so it couldn't catch Gson writing JSONObject internals into the targeting cache, the bug fixed in #58.

What Changed

  • android_sdk: add LocalStorageTargetingCacheTest, two Robolectric tests that cache a parsed targeting response, read it back through a new LocalStorage instance (as after an app restart), and check that targetingData keeps its nested objects, arrays and number types.

LocalStorageTest mocks SharedPreferences and JSONObject, so it couldn't
catch Gson writing JSONObject internals into the cache (fixed in #58).
These Robolectric tests cache a parsed targeting response, read it back
through a new LocalStorage instance, and check that targetingData keeps
its nested objects, arrays and number types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jrosendahl-opt
jrosendahl-opt requested review from a team as code owners November 10, 2026 01:10
@jrosendahl-opt
jrosendahl-opt merged commit eba4eea into master Nov 11, 2026
3 checks passed
@jrosendahl-opt
jrosendahl-opt deleted the test/targeting-cache-roundtrip branch November 11, 2026 16:51
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 this pull request may close these issues.

2 participants