Skip to content

fix(android): preserve flushing before SDK shutdown - #1270

Merged
kikoveiga merged 1 commit into
developfrom
kikoveiga/fix-android-flush-shutdown
Oct 30, 2026
Merged

kikoveiga merged 1 commit into
developfrom
kikoveiga/fix-android-flush-shutdown

Conversation

@kikoveiga

Copy link
Copy Markdown
Contributor

What and why?

Keep the Android flushAndDeinitialize() test helper flushing pending events before stopping the SDK. Its reflection lookup hardcodes a Kotlin JVM method suffix that changes with the built-in Kotlin migration in DataDog/dd-sdk-android#4060, causing the flush to be silently skipped and potentially losing final events in integration/E2E tests.

How?

  • Call Datadog._internalProxy().flushAndShutdownExecutors(), matching the existing flush helper, and remove the unused reflection helper.
  • Add a regression test verifying flush → stop → method-channel success ordering.
  • Keep the existing Android SDK dependency version.

Validation

  • Android native unit suite: 77 tests passed; the new regression test fails before the fix and passes afterward.
  • melos run analyze:android --no-select: passed (existing script scope).
  • Flutter unit tests passed in 16 packages, including the affected Android plugin; the two remaining example/test apps are blocked by missing local .env assets.
  • Repository Dart checks report formatting differences in three unchanged Dart files and missing example .env assets / existing analyzer notices.

Review checklist

  • This pull request has appropriate unit and / or integration tests
  • This pull request references a Github or JIRA issue

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Pipelines

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 636970a | Docs | View more details | Give us feedback!

@kikoveiga
kikoveiga marked this pull request as ready for review October 30, 2026 12:20
@kikoveiga
kikoveiga requested a review from a team as a code owner October 30, 2026 12:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T12:22:34.167758Z 636970a Draft marked ready
🔒 Security Review ✅ Completed 2026-10-30T12:23:23.816384Z 636970a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-5 datadog-prod-us1-5 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The shutdown helper reaches the existing flush API without relying on Kotlin’s mangled method suffix, preserving flush → stop → success ordering. The specialist identified no actionable defects in the implementation or regression test.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 636970a

@kikoveiga
kikoveiga merged commit 81d47b7 into develop Oct 30, 2026
17 checks passed
@kikoveiga
kikoveiga deleted the kikoveiga/fix-android-flush-shutdown branch October 30, 2026 14:18
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