Skip to content

Add test coverage for MainActivity dual-intent Bolt opening logic#69

Draft
Copilot wants to merge 7 commits intobolt_deeplink_hackfrom
copilot/sub-pr-63
Draft

Add test coverage for MainActivity dual-intent Bolt opening logic#69
Copilot wants to merge 7 commits intobolt_deeplink_hackfrom
copilot/sub-pr-63

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 19, 2026

PR #63 introduced dual-intent logic for opening Bolt (app intent → web intent) but lacked test coverage. This PR adds comprehensive tests verifying intent sequencing, timing, and error isolation.

Changes

New test file: MainActivityIntentTest.kt (308 lines)

  • Intent sequence validation: Uber → Bolt app (pkg: ee.mtakso.client) → Bolt web
  • Timing verification: 500ms delays between intents
  • Error isolation: Uber/Bolt failures don't crash or block other intents
  • Intent flags: FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_LAUNCH_ADJACENT

Test approach:

  • Robolectric + ShadowActivity to capture intents from private openInSplitScreen()
  • Thread.sleep() for coroutine sync (real kotlinx.coroutines.delay in production)
  • Helper methods (invokeOpenInSplitScreen, collectAllIntents) reduce duplication
  • Constants (MIN_DELAY_MS=400L, TEST_WAIT_MS=600L) for timing tolerance

Example test:

@Test
fun testOpenInSplitScreen_correctIntentSequence() {
    val shadowActivity = shadowOf(activity)
    invokeOpenInSplitScreen(uberDeepLink, boltDeepLink, boltDeepLinkWeb)
    val (intent1, intent2, intent3) = collectAllIntents(shadowActivity)
    
    assertEquals(Uri.parse(uberDeepLink), intent1?.data)
    assertEquals(Uri.parse(boltDeepLink), intent2?.data)
    assertEquals("ee.mtakso.client", intent2?.`package`)
    assertEquals(Uri.parse(boltDeepLinkWeb), intent3?.data)
}

Documentation:

  • Updated test README with section 12 describing coverage

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 6 commits January 19, 2026 16:48
…ning flow

Co-authored-by: neteinstein <910242+neteinstein@users.noreply.github.com>
Co-authored-by: neteinstein <910242+neteinstein@users.noreply.github.com>
Co-authored-by: neteinstein <910242+neteinstein@users.noreply.github.com>
Co-authored-by: neteinstein <910242+neteinstein@users.noreply.github.com>
Co-authored-by: neteinstein <910242+neteinstein@users.noreply.github.com>
Co-authored-by: neteinstein <910242+neteinstein@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 19, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=512m -XX:&#43;HeapDumpOnOutOfMemoryError -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] WIP address feedback on Bolt deep link fix implementation Add test coverage for MainActivity dual-intent Bolt opening logic Jan 19, 2026
Copilot AI requested a review from neteinstein January 19, 2026 16:59
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