Skip to content

Bug 2016766: [ci full] updates the return type of methodrecordEventOrThrow() in a Nimbus Android SDK#7223

Open
yashikakhurana wants to merge 7 commits intomainfrom
bug_2016766
Open

Bug 2016766: [ci full] updates the return type of methodrecordEventOrThrow() in a Nimbus Android SDK#7223
yashikakhurana wants to merge 7 commits intomainfrom
bug_2016766

Conversation

@yashikakhurana
Copy link
Contributor

This PR updates the return type of methodrecordEventOrThrow() in a Nimbus Android SDK

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Comment on lines 487 to 490
override fun recordEventOrThrow(count: Long, eventId: String): CompletableJob =
dbScope.launch {
nimbusClient.recordEvent(eventId, count)
}
} as CompletableJob
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
override fun recordEventOrThrow(count: Long, eventId: String): CompletableJob =
dbScope.launch {
nimbusClient.recordEvent(eventId, count)
}
} as CompletableJob
override fun recordEventOrThrow(count: Long, eventId: String): Job =
dbScope.launch {
nimbusClient.recordEvent(eventId, count)
}

This type information is not correct -- CoroutineScope.launch returns a abstract Job, so casting it is unsafe and relies on the internals.

Undo this change.

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.

2 participants