Skip to content

Add default reporting field to push messages for default click reporting - #275

Open
matusekma wants to merge 5 commits into
devfrom
SDK-1127-pushclick
Open

matusekma wants to merge 5 commits into
devfrom
SDK-1127-pushclick

Conversation

@matusekma

@matusekma matusekma commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

SDK-1127

In case there is no defaultAction in the push payload, the backend provides a top level reporting field under the notification property on each platform. That should be used to populate the reporting field of the reporting actions.

@hyperspace-pr-bot

hyperspace-pr-bot Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Control Panel

Hi, I'm an AI-powered Review Bot that helps you with summarizing and reviewing pull requests.
To interact with me, just use the following actions:

  • 📝 Summarize PR
  • 🔍 Review
  • 🗑️ Delete all bot comments and reviews

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The review has been concluded!

PR Bot Information

Version: 1.31.43

  • Event Trigger: issue_comment.edited
  • Correlation ID: ed6d5530-b5cb-11f1-9a58-0760004f8c75
  • File Content Strategy: Full file content
  • LLM: gpt-5.5

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Posted review comments for the issues found: missing web fallback for reporting, non-serializable Url in serializable events, and an invalid JSON test constant. One additional iOS fallback issue remains worth addressing as well: the new required reporting field in iOS payload models should default to PushConstants.PUSH_DEFAULT_REPORTING to avoid deserialization failures for payloads that omit it.

PR Bot Information

Version: 1.31.43

  • Event Trigger: issue_comment.created
  • Correlation ID: a633eea0-b656-11f1-80cb-be6edf774c63
  • LLM: gpt-5.5
  • File Content Strategy: Full file content


@Serializable
internal data class RemoteWebPushNotificationV2(
val reporting: String,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Missing fallback makes web push decoding fail when reporting is absent

The Android path tolerates missing reporting by using PUSH_DEFAULT_REPORTING, but the web remote model now requires the field. Any existing V2 payload without notification.reporting will fail to decode and the notification will not be processed.

Consider defaulting this property to PushConstants.PUSH_DEFAULT_REPORTING.

Suggested change
val reporting: String,
val reporting: String = PushConstants.PUSH_DEFAULT_REPORTING,

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

*/
sealed interface OperationalEvent : Internal, OnlineSdkEvent {
val applicationCode: String?
val targetUrl: Url?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Url is not serializable in these @Serializable events

OperationalEvent implementations are serializable event data classes, so adding a Url? property requires a kotlinx serializer for io.ktor.http.Url; otherwise this will fail compilation or event persistence serialization. Consider storing a serializable value such as the URL string instead, or mark this runtime-only field as transient if it must not be persisted.

Suggested change
val targetUrl: Url?
val targetUrl: String?

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

const val COLLAPSE_ID = "testCollapseId"
const val TRACKING_INFO = """{"trackingInfoKey":"trackingInfoValue"}"""
const val REPORTING = """{"reportingKey":"reportingValue"}"""
const val DEFAULT_REPORTING = """{defaultReportingKey":"defaultReportingValue"}"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo: Default reporting test payload is invalid JSON

The opening quote of defaultReportingKey is missing, so this test now exercises a malformed reporting payload while the rest of the suite uses valid JSON. Consider fixing the literal to keep assertions representative of the production payload.

Suggested change
const val DEFAULT_REPORTING = """{defaultReportingKey":"defaultReportingValue"}"""
const val DEFAULT_REPORTING = """{"defaultReportingKey":"defaultReportingValue"}"""

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

@hyperspace-pr-bot hyperspace-pr-bot Bot deleted a comment from matusekma Sep 22, 2026
@matusekma
matusekma changed the base branch from main to dev September 22, 2026 07:27

This branch has not been deployed

No deployments
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.

1 participant