Skip to content

FFLSDK-254: Cover first-flags timeout and delayed delivery - #3961

Closed
typotter wants to merge 1 commit into
typo/android-flags-event-shapefrom
codex/android-first-flags-timing-tests
Closed

typotter wants to merge 1 commit into
typo/android-flags-event-shapefrom
codex/android-first-flags-timing-tests

Conversation

@typotter

@typotter typotter commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Adds coverage for two non-blocking timing suggestions from #3945:

  • With a real repository, initialization timeout emits no first-flags notification; a later successful response emits one without completing the context callback twice.
  • With real client integration and queued delivery, the event retains the first installation’s keys while resolution inside the callback reads the newer installed values.

No production or public API changes.

Validation: 61 manager/integration tests pass in each debug and release variant, plus Detekt and ktlintCheck. The patch is identical to the locally validated changes.

Review context: timeout before late success, queued delivery after a newer installation.

@typotter
typotter requested a review from sameerank October 5, 2026 21:03
@typotter
typotter requested review from a team as code owners October 5, 2026 21:03
@typotter
typotter requested review from leoromanovsky and removed request for a team October 5, 2026 21:03
@linear-code

linear-code Bot commented Oct 5, 2026

Copy link
Copy Markdown

FFLSDK-254

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-06T17:23:29.776231Z 22b072a New commits
🔒 Security Review ✅ Completed 2026-10-06T17:21:53.621754Z 22b072a New commits
ℹ️ 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-official

datadog-official Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 58.54% (+0.00%)

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

@typotter
typotter force-pushed the codex/android-first-flags-timing-tests branch from 10c15d1 to 22b072a Compare October 6, 2026 17:19

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22b072a3f9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}

@Test
fun `M retain first keys but resolve current values W newer flags install before queued delivery`() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use the required RUM ticket prefix

The commit subject starts with FFLSDK-254, but repository policy requires every commit title to use the RUM-XXXXX: <short description> format. Rename the commit subject to the required RUM ticket prefix so it passes the repository's commit-title policy.

AGENTS.md reference: AGENTS.md:L127-L131

Useful? React with 👍 / 👎.

}

@Test
fun `M retain first keys but resolve current values W newer flags install before queued delivery`() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Name the first-flags test after the method under test

The W clause describes the timing scenario instead of naming the exercised method, so this new test does not follow the required M <expected behavior> W <method()> {context} convention. Rename it to identify onFirstFlags() (with the delayed-delivery condition in braces) so test reports remain consistent and searchable.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

}

@Test
fun `M notify first flags once W successful response arrives after initialization timeout`() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Name the timeout test after updateEvaluationsForContext

The W clause contains only the response/timeout scenario and omits the method under test, contrary to the required M <expected behavior> W <method()> {context} naming convention. Use W updateEvaluationsForContext() {successful response after initialization timeout} so this test follows the suite's documented format.

AGENTS.md reference: AGENTS.md:L95-L95

Useful? React with 👍 / 👎.

val work = ArrayDeque<Runnable>()
doAnswer { work.add(it.getArgument(0)); null }.whenever(mockExecutorService).execute(any())
lateinit var timeout: () -> Unit
val manager = EvaluationsManager(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prefix the manager under test with tested

This EvaluationsManager is the object exercised by the test, but it is named manager rather than using the repository-required tested prefix. Rename it to testedManager and update the invocation so the test follows the documented object-under-test convention.

AGENTS.md reference: AGENTS.md:L78-L78

Useful? React with 👍 / 👎.

@typotter

typotter commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #3945 at 98c3d9c. Both timing regressions, including the addressed readability feedback, were folded into #3945 at Tyler"s request so they receive review together. The combined native suite passes 474 tests per debug/release variant, plus static checks. Closing this now-redundant test-only follow-up; its branch is retained.

@typotter typotter closed this Oct 6, 2026
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