-
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 ?
| 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?
| body.put( | ||
| "timestamp", | ||
| DateUtils.iso8601Format().apply { | ||
| timeZone = TimeZone.getTimeZone("UTC") |
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.
we did something around timezone earlier, do we have to keep anything in mind here @nan-li ?
| * 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
| } | ||
|
|
||
| companion object { | ||
| private const val DEVICE_TYPE = "device_type" |
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.
| import com.onesignal.user.internal.operations.TrackCustomEventOperation | ||
|
|
||
| internal class CustomEventOperationExecutor( | ||
| private val _customEventBackendService: ICustomEventBackendService, |
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.
did the _ pass lint? this not a standard kotlin way IMHO
| NetworkUtils.ResponseStatusType.RETRYABLE -> | ||
| ExecutionResponse(ExecutionResult.FAIL_RETRY, retryAfterSeconds = ex.retryAfterSeconds) | ||
| else -> | ||
| // TODO: will not retry all other error until we finalize how to handle |
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.
why todo? do we need to make any other decision here?
| } | ||
|
|
||
| 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
| 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?
Rebase and resolve conflicts from main.
This change is