MOBILE-173: Add anntations SerializedName for WebviewBridge#711
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens WebView bridge JSON compatibility under obfuscation by adding explicit @SerializedName mappings, and adds unit tests that document/lock in the current behavior of several custom GSON adapters used by the SDK’s operation models.
Changes:
- Added
@SerializedNameannotations to WebView bridge messages and payload DTOs to ensure stable JSON keys. - Added new unit tests covering read/write/round-trip behavior for multiple GSON
TypeAdapters (DateOnly, DateTime, Ids, CustomFields, ProductList response polymorphism, MindboxError). - Tightened
consumer-rules.prokeep rules (narrower in-app DTO scope; removed overly broad Preference keep rule).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/ProductListResponseAdapterTest.kt | New tests for array/object/null dispatch behavior of ProductListResponseAdapter. |
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/IdsAdapterTest.kt | New tests validating numeric IDs are read as strings and documenting adapter limitations. |
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/DateTimeAdapterTest.kt | New tests for ISO8601 parsing and current DateTime write format behavior. |
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/DateOnlyAdapterTest.kt | New tests for DateOnly parsing/serialization behavior. |
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/operation/adapters/CustomerFieldsAdapterTest.kt | New tests for CustomFields map read/write and convertTo behavior. |
| sdk/src/test/java/cloud/mindbox/mobile_sdk/models/MindboxErrorAdapterTest.kt | New tests for MindboxError.toJson() output and documented current read() behavior. |
| sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/WebViewInappViewHolder.kt | Added missing @SerializedName annotations for WebView bridge payload fields. |
| sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/WebViewAction.kt | Added @SerializedName annotations to bridge message fields for stable JSON keys. |
| sdk/consumer-rules.pro | Adjusted keep rules (removed enum rule, narrowed in-app keep scope to DTO members, removed Preference keep). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
35887e7 to
d4e5b6c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://tracker.yandex.ru/MOBILE-173