Skip to content

Conversation

@jinliu9508
Copy link
Contributor

@jinliu9508 jinliu9508 commented Jan 21, 2026

Rebase and resolve conflicts from main.


This change is Reviewable

jkasten2 and others added 9 commits January 21, 2026 16:47
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
@jinliu9508 jinliu9508 changed the base branch from 5.6-main to main January 21, 2026 21:53
@jinliu9508 jinliu9508 changed the title chore: resolve conflict between 5.3.0_beta_branch and 5.6-main chore: merge 5.3.0 beta into main and resolve conflict Jan 21, 2026
@@ -1,15 +1,11 @@
name: Build and Test SDK

concurrency:
Copy link
Contributor

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,
Copy link
Contributor

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) }
Copy link
Contributor

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")
Copy link
Contributor

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 {
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move all these into a central location?
i see a bunch of keys used in several places, all of them hardcoded.

import com.onesignal.user.internal.operations.TrackCustomEventOperation

internal class CustomEventOperationExecutor(
private val _customEventBackendService: ICustomEventBackendService,
Copy link
Contributor

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
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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?

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.

5 participants