-
Notifications
You must be signed in to change notification settings - Fork 376
chore: merge 5.3.0 beta into main and resolve conflict #2525
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
base: main
Are you sure you want to change the base?
Conversation
chore: Kotlin 1.9 update
chore(tests): add SessionListenerTests class
ci: create release prs for wrappers for new android sdk release
Co-authored-by: AR Abdul Azeez <abdul@onesignal.com>
- removed CustomEvent and immediately save custom event properties into a JSONObject - renamed TrackEventOperation to TrackCustomEventOperation - removed app_id in body - fix comparison key to unique custom event key - fix some test units to prevent them from failing
629ab0b to
db81966
Compare
| @@ -1,15 +1,11 @@ | |||
| name: Build and Test SDK | |||
|
|
|||
| concurrency: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder why this file would get impacted @jinliu9508 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from resolving the conflict. I have updated the ci.yml with the most recent one.
| return when (value) { | ||
| null, | ||
| is Boolean, | ||
| is Number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about finite checks?
| is JSONObject, | ||
| is JSONArray, | ||
| -> true | ||
| is Map<*, *> -> value.keys.all { it is String } && value.values.all { isValidJsonObject(it) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please write a unit test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added more tests for JSONUtils.kt
...ore/src/main/java/com/onesignal/user/internal/customEvents/impl/CustomEventBackendService.kt
Show resolved
Hide resolved
| * Recursively convert a JSON-serializable map into a JSON-compatible format, handling | ||
| * nested Maps and Lists appropriately. | ||
| */ | ||
| private fun mapToJson(map: Map<String, Any>): JSONObject { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the two methods be placed in json utils class? and we should write unit tests for these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. These are generic and are now moved into JSONUtils.kt
...gnal/core/src/main/java/com/onesignal/user/internal/customEvents/impl/CustomEventMetadata.kt
Show resolved
Hide resolved
...n/java/com/onesignal/user/internal/operations/impl/executors/CustomEventOperationExecutor.kt
Outdated
Show resolved
Hide resolved
...n/java/com/onesignal/user/internal/operations/impl/executors/CustomEventOperationExecutor.kt
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| companion object { | ||
| const val CUSTOM_EVENT = "custom-event" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should go the centralized constants class/interface as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be done in a separate future PR.
| setOptStringProperty(::eventProperties.name, value) | ||
| } | ||
|
|
||
| override val createComparisonKey: String get() = "$appId.User.$onesignalId.CustomEvent.$eventName" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both are same? is that expected?
db81966 to
d335b1b
Compare
📊 Diff Coverage ReportDiff Coverage ReportThreshold: 80% Changed Files Coverage
Overall Coverage275/397 lines covered (69.3%) ❌ Coverage Check FailedFiles below 80% threshold:
|
Rebase and resolve conflicts from main.
This change is