Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Image Proxy Bug Fix

  • Analyze the codebase to understand the image proxy implementation
  • Identify the root cause of image loading issues
  • Fix the WebView configuration bug that blocks network loads when proxy is enabled
  • Add Cloudflare WARP ToS consent dialog
  • Create integration tests for external images with proxy
  • Update documentation
  • Run code review and CodeQL checker
  • Fix CI test failures (CloudflareTermsConsentE2ETest, ImageProxyIntegrationTest)
  • Fix outlink click handling in WebView (open links in browser)
  • Add long-press link context menu (copy link / open)
  • Address code review feedback (reduce duplication)
  • Fix toSAlreadyAccepted_noDialogShownWhenEnablingProxy test race condition
  • Improve test reliability (use mainClock instead of Thread.sleep)
  • Fix BackNavigationTest crash and test reliability issues
  • Refactor to reduce code duplication (helper functions for external links)

Latest Fixes

  1. FLAG_ACTIVITY_NEW_TASK for startActivity calls: Added FLAG_ACTIVITY_NEW_TASK to all startActivity calls in EmailDetailScreen to prevent crashes when starting activities from non-Activity contexts (WebView callbacks).

  2. BackNavigationTest reliability improvements:

    • Added waitForIdle() calls between activity scenario transitions to ensure database writes complete
    • Added waitForIdle() after click actions to ensure UI transitions complete
  3. Code duplication reduction:

    • Extracted openUrlInBrowser helper function for opening HTTP/HTTPS URLs
    • Added openMailtoLink helper function for opening mailto: links
    • Simplified shouldOverrideUrlLoading to use these helper functions
Original prompt

your task is to fix bugs around the image proxy feature such that when the user clicks the load image button, the images are actually fetched from the proxy; currently all image from remote cannot be shown even if the user allows loading image in the settings or click load images manually in the email view. the expected behavior is that the remote images from emails are loaded properly through the proxy. Please make sure the integration/end-to-end tests cover the scenario where the email contains external images, and test on the image proxy to be correctly used to load them. Note that the Cloudflare WARP ToS consent is also nowhere to be found in the app and address that as well.

Please implement fixes and test cases (mostly integration & end-to-end tests) to verify your fix. Follow best practices and write idiomatic code with comprehensive test & documentation coverage, and update existing documents & create new documents for all design decisions you made during inspecting & fixing the codebase. Make sure all implementations are correct, secure, and efficient especially around the FFI boundary. Analyze carefully on performance impacts and implement the most efficient design following best practices.


💡 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 3 commits January 16, 2026 20:48
- Fix WebView blockNetworkLoads bug that prevented proxy interception
- Add Cloudflare WARP Terms of Service consent dialog
- Create integration tests for image proxy feature
- Create E2E tests for ToS consent flow
- Update documentation

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bugs in image proxy feature for displaying remote images Fix image proxy WebView interception and add Cloudflare WARP ToS consent Jan 16, 2026
Copilot AI requested a review from MinecraftFuns January 16, 2026 20:58
@MinecraftFuns
Copy link
Contributor

@copilot The Android UI testing CI failed. Please properly address the issues in the failed CI run as well as any potential issues that could arise in future CI/test case steps once the current issues are fixed. Please fix & test another issue with the email WebView view that if the user clicks an outlink embedded in the email, the app does nothing; the expected behavior is to open the link using the default browser, and a long press of the link would prompt the user to select whether to open the link or to copy into clipboard (follow conventional/canonical UI/UX best practices).

8m 26s
Run ./gradlew pixel7Api34StagingDebugAndroidTest
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build

Configure project :app
WARNING: The option setting 'android.experimental.testOptions.managedDevices.setupTimeoutMinutes=30' is experimental.
WARNING: The option setting 'android.experimental.testOptions.managedDevices.maxConcurrentDevices=1' is experimental.
WARNING: The option setting 'android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect' is experimental.
Version Info: name=v0.0.6-dev.27+3656f30, code=3099, stable=false, buildType=LOCAL

Task :app:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :app:cargoNdkBuild SKIPPED
Task :app:preBuild UP-TO-DATE
Task :app:preStagingDebugBuild UP-TO-DATE
Task :app:generateStagingDebugBuildConfig
Task :app:generateStagingDebugResValues
Task :app:checkStagingDebugAarMetadata
Task :app:mapStagingDebugSourceSetPaths
Task :app:generateStagingDebugResources
Task :app:packageStagingDebugResources
Task :app:createStagingDebugCompatibleScreenManifests
Task :app:extractDeepLinksStagingDebug
Task :app:parseStagingDebugLocalResources
Task :app:mergeStagingDebugResources
Task :app:processStagingDebugMainManifest
Task :app:processStagingDebugManifest
Task :app:processStagingDebugManifestForPackage
Task :app:javaPreCompileStagingDebug
Task :app:preStagingDebugAndroidTestBuild SKIPPED
Task :app:processStagingDebugAndroidTestManifest
Task :app:generateStagingDebugAndroidTestBuildConfig
Task :app:checkStagingDebugAndroidTestAarMetadata
Task :app:generateStagingDebugAndroidTestResValues
Task :app:mapStagingDebugAndroidTestSourceSetPaths
Task :app:generateStagingDebugAndroidTestResources
Task :app:javaPreCompileStagingDebugAndroidTest
Task :app:mergeStagingDebugShaders
Task :app:compileStagingDebugShaders NO-SOURCE
Task :app:generateStagingDebugAssets UP-TO-DATE
Task :app:mergeStagingDebugAndroidTestResources
Task :app:mergeStagingDebugAssets
Task :app:compressStagingDebugAssets
Task :app:desugarStagingDebugFileDependencies
Task :app:checkStagingDebugDuplicateClasses
Task :app:processStagingDebugAndroidTestResources
Task :app:mergeStagingDebugJniLibFolders
Task :app:processStagingDebugResources
Task :app:mergeLibDexStagingDebug
Task :app:mergeStagingDebugNativeLibs
Task :app:validateSigningStagingDebug
Task :app:writeStagingDebugAppMetadata
Task :app:writeStagingDebugSigningConfigVersions

Task :app:stripStagingDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libandroidx.graphics.path.so, libboringtun-4bcc3f0a8d059b65.so, libdatastore_shared_counter.so, libjnidispatch.so, libletterbox_core.so, libletterbox_proxy.so.

Task :app:mergeStagingDebugAndroidTestShaders
Task :app:compileStagingDebugAndroidTestShaders NO-SOURCE
Task :app:generateStagingDebugAndroidTestAssets UP-TO-DATE
Task :app:mergeStagingDebugAndroidTestAssets
Task :app:compressStagingDebugAndroidTestAssets
Task :app:checkStagingDebugAndroidTestDuplicateClasses
Task :app:desugarStagingDebugAndroidTestFileDependencies
Task :app:mergeExtDexStagingDebugAndroidTest
Task :app:mergeLibDexStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestJniLibFolders
Task :app:mergeStagingDebugAndroidTestNativeLibs NO-SOURCE
Task :app:stripStagingDebugAndroidTestDebugSymbols NO-SOURCE
Task :app:validateSigningStagingDebugAndroidTest
Task :app:writeStagingDebugAndroidTestSigningConfigVersions
Task :app:mergeExtDexStagingDebug

Task :app:kaptGenerateStubsStagingDebugKotlin
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.

Task :app:kaptStagingDebugKotlin
Task :app:pixel7Api34Setup
Task :app:compileStagingDebugKotlin
Task :app:compileStagingDebugJavaWithJavac
Task :app:bundleStagingDebugClassesToCompileJar
Task :app:dexBuilderStagingDebug
Task :app:mergeStagingDebugGlobalSynthetics
Task :app:mergeProjectDexStagingDebug
Task :app:processStagingDebugJavaRes

Task :app:kaptGenerateStubsStagingDebugAndroidTestKotlin
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.

Task :app:mergeStagingDebugJavaResource
Task :app:kaptStagingDebugAndroidTestKotlin
Task :app:packageStagingDebug
Task :app:createStagingDebugApkListingFileRedirect
Task :app:compileStagingDebugAndroidTestKotlin
Task :app:compileStagingDebugAndroidTestJavaWithJavac
Task :app:dexBuilderStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestGlobalSynthetics
Task :app:mergeProjectDexStagingDebugAndroidTest
Task :app:processStagingDebugAndroidTestJavaRes
Task :app:mergeStagingDebugAndroidTestJavaResource
Task :app:packageStagingDebugAndroidTest
Task :app:createStagingDebugAndroidTestApkListingFileRedirect

Task :app:pixel7Api34StagingDebugAndroidTest
Starting 47 tests on pixel7Api34

pixel7Api34 Tests 0/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 2/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 3/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 5/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 6/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 7/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 8/47 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 10/47 completed. (0 skipped) (0 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > toSAlreadyAccepted_noDialogShownWhenEnablingProxy[pixel7Api34] FAILED
java.lang.AssertionError: Privacy proxy should be enabled directly when ToS already accepted
at org.junit.Assert.fail(Assert.java:89)

pixel7Api34 Tests 11/47 completed. (0 skipped) (1 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > disablingProxy_afterToSAccepted_noDialogShown[pixel7Api34] FAILED
java.lang.AssertionError: Privacy proxy should be disabled
at org.junit.Assert.fail(Assert.java:89)

pixel7Api34 Tests 12/47 completed. (0 skipped) (2 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > tosDialogContainsLinkToCloudflareTerms[pixel7Api34] FAILED
androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 3000 ms
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.waitUntil(ComposeUiTest.android.kt:441)

pixel7Api34 Tests 13/47 completed. (0 skipped) (3 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > enablingPrivacyProxy_withoutToSAccepted_showsTermsDialog[pixel7Api34] FAILED
androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 3000 ms
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.waitUntil(ComposeUiTest.android.kt:441)

pixel7Api34 Tests 14/47 completed. (0 skipped) (4 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > acceptingToS_enablesProxyAndSavesConsent[pixel7Api34] FAILED
androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 3000 ms
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.waitUntil(ComposeUiTest.android.kt:441)

pixel7Api34 Tests 15/47 completed. (0 skipped) (5 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > decliningToS_keepsProxyDisabledAndNoConsent[pixel7Api34] FAILED
androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 3000 ms
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.waitUntil(ComposeUiTest.android.kt:441)

pixel7Api34 Tests 17/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 18/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 20/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 23/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 25/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 27/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 29/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 30/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 32/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 34/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 36/47 completed. (0 skipped) (6 failed)
pixel7Api34 Tests 37/47 completed. (0 skipped) (6 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.ImageProxyIntegrationTest > emailWithRemoteImages_alwaysLoadEnabled_noBannerShown[pixel7Api34] FAILED
java.lang.SecurityException: Permission denied - application missing INTERNET permission
at com.android.webview.chromium.ContentSettingsAdapter.setBlockNetworkLoads(chromium-TrichromeWebViewGoogle6432.apk-stable-567263637:23)

pixel7Api34 Tests 38/47 completed. (0 skipped) (7 failed)
pixel7Api34 Tests 40/47 completed. (0 skipped) (7 failed)
pixel7Api34 Tests 42/47 completed. (0 skipped) (7 failed)
pixel7Api34 Tests 44/47 completed. (0 skipped) (7 failed)
pixel7Api34 Tests 46/47 completed. (0 skipped) (7 failed)
pixel7Api34 Tests 47/47 completed. (0 skipped) (7 failed)
Finished 47 tests on pixel7Api34

Task :app:pixel7Api34StagingDebugAndroidTest
Tests on pixel7Api34 failed: There was 7 failure(s).

Task :app:pixel7Api34StagingDebugAndroidTest FAILED

Task :app:mergeStagingDebugAndroidTestTestResultProtos
Test execution completed. See the report at: file:///home/runner/work/Letterbox/Letterbox/app/build/reports/androidTests/managedDevice/debug/flavors/staging/allDevices/index.html

gradle/actions: Writing build results to /home/runner/work/_temp/.gradle-actions/build-results/__run_10-1768626226356.json
FAILURE: Build failed with an exception.

[Incubating] Problems report is available at: file:///home/runner/work/Letterbox/Letterbox/build/reports/problems/problems-report.html

  • What went wrong:

Execution failed for task ':app:pixel7Api34StagingDebugAndroidTest'.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

There were failing tests. See the report at: file:///home/runner/work/Letterbox/Letterbox/app/build/reports/androidTests/managedDevice/debug/flavors/staging/pixel7Api34/index.html

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org./

BUILD FAILED in 8m 25s

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
73 actionable tasks: 73 executed
Error: Process completed with exit code 1.

Please implement fixes and test cases (mostly integration & end-to-end tests) to verify your fix. Follow best practices and write idiomatic code with comprehensive test & documentation coverage, and update existing documents & create new documents for all design decisions you made during inspecting & fixing the codebase. Make sure all implementations are correct, secure, and efficient especially around the FFI boundary. Analyze carefully on performance impacts and implement the most efficient design following best practices.

Copilot AI and others added 2 commits January 17, 2026 06:23
- Fix CloudflareTermsConsentE2ETest to use test tags for Switch components
- Add test tags to privacy proxy and always load switches
- Handle SecurityException when app lacks INTERNET permission
- Add outlink click handling to open links in external browser
- Add long-press context menu for links and images (copy/open)
- Add LinkHandlingE2ETest for link interaction tests
- Update ImageProxyIntegrationTest to account for no INTERNET permission
- Update documentation with link handling section

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
- Extract openUrlInBrowser and copyToClipboard helper functions
- Simplify showLinkContextMenu and showImageContextMenu
- Fix inconsistent Assert import in ImageProxyIntegrationTest

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot The Android UI testing CI failed. Please properly address the issues in the failed CI run as well as any potential issues that could arise in future CI/test case steps once the current issues...

Fixed in commits 1d13a96 and 6515378.

CI Test Failures Fixed:

  • CloudflareTermsConsentE2ETest: Now uses test tags (privacyProxySwitch) to reliably target Switch components instead of clicking on text labels
  • ImageProxyIntegrationTest: Handles SecurityException gracefully when app lacks INTERNET permission (by design for privacy)

Outlink Click Handling Added:

  • HTTP/HTTPS links now open in the default browser
  • mailto: links open in the default email client
  • Long-press on links shows context menu: "Open link" / "Copy link address"
  • Long-press on images shows context menu: "Open image" / "Copy image URL"

New Tests:

  • LinkHandlingE2ETest.kt added to verify link handling doesn't crash the app

@MinecraftFuns
Copy link
Contributor

@copilot The Android UI testing CI failed. Please properly address the issues in the failed CI run as well as any potential issues that could arise in future CI/test case steps once the current issues are fixed.

Run ./gradlew pixel7Api34StagingDebugAndroidTest
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build

Configure project :app
WARNING: The option setting 'android.experimental.testOptions.managedDevices.setupTimeoutMinutes=30' is experimental.
WARNING: The option setting 'android.experimental.testOptions.managedDevices.maxConcurrentDevices=1' is experimental.
WARNING: The option setting 'android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect' is experimental.
Version Info: name=v0.0.6-dev.29+6515378, code=3101, stable=false, buildType=LOCAL

Task :app:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :app:cargoNdkBuild SKIPPED
Task :app:preBuild UP-TO-DATE
Task :app:preStagingDebugBuild UP-TO-DATE
Task :app:generateStagingDebugBuildConfig
Task :app:checkStagingDebugAarMetadata
Task :app:generateStagingDebugResValues
Task :app:mapStagingDebugSourceSetPaths
Task :app:generateStagingDebugResources
Task :app:packageStagingDebugResources
Task :app:createStagingDebugCompatibleScreenManifests
Task :app:extractDeepLinksStagingDebug
Task :app:parseStagingDebugLocalResources
Task :app:mergeStagingDebugResources
Task :app:processStagingDebugMainManifest
Task :app:processStagingDebugManifest
Task :app:preStagingDebugAndroidTestBuild SKIPPED
Task :app:javaPreCompileStagingDebug
Task :app:processStagingDebugAndroidTestManifest
Task :app:generateStagingDebugAndroidTestBuildConfig
Task :app:processStagingDebugManifestForPackage
Task :app:checkStagingDebugAndroidTestAarMetadata
Task :app:generateStagingDebugAndroidTestResValues
Task :app:mapStagingDebugAndroidTestSourceSetPaths
Task :app:generateStagingDebugAndroidTestResources
Task :app:javaPreCompileStagingDebugAndroidTest
Task :app:mergeStagingDebugShaders
Task :app:compileStagingDebugShaders NO-SOURCE
Task :app:generateStagingDebugAssets UP-TO-DATE
Task :app:mergeStagingDebugAndroidTestResources
Task :app:mergeStagingDebugAssets
Task :app:compressStagingDebugAssets
Task :app:desugarStagingDebugFileDependencies
Task :app:checkStagingDebugDuplicateClasses
Task :app:processStagingDebugAndroidTestResources
Task :app:mergeStagingDebugJniLibFolders
Task :app:mergeLibDexStagingDebug
Task :app:processStagingDebugResources
Task :app:mergeStagingDebugNativeLibs
Task :app:validateSigningStagingDebug
Task :app:writeStagingDebugAppMetadata
Task :app:writeStagingDebugSigningConfigVersions
Task :app:mergeStagingDebugAndroidTestShaders

Task :app:stripStagingDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libandroidx.graphics.path.so, libboringtun-4bcc3f0a8d059b65.so, libdatastore_shared_counter.so, libjnidispatch.so, libletterbox_core.so, libletterbox_proxy.so.

Task :app:compileStagingDebugAndroidTestShaders NO-SOURCE
Task :app:generateStagingDebugAndroidTestAssets UP-TO-DATE
Task :app:mergeStagingDebugAndroidTestAssets
Task :app:compressStagingDebugAndroidTestAssets
Task :app:checkStagingDebugAndroidTestDuplicateClasses
Task :app:desugarStagingDebugAndroidTestFileDependencies
Task :app:mergeLibDexStagingDebugAndroidTest
Task :app:mergeExtDexStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestJniLibFolders
Task :app:mergeStagingDebugAndroidTestNativeLibs NO-SOURCE
Task :app:stripStagingDebugAndroidTestDebugSymbols NO-SOURCE
Task :app:validateSigningStagingDebugAndroidTest
Task :app:writeStagingDebugAndroidTestSigningConfigVersions
Task :app:mergeExtDexStagingDebug

Task :app:kaptGenerateStubsStagingDebugKotlin
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.

Task :app:kaptStagingDebugKotlin
Task :app:pixel7Api34Setup
Task :app:compileStagingDebugKotlin
Task :app:compileStagingDebugJavaWithJavac
Task :app:bundleStagingDebugClassesToCompileJar
Task :app:dexBuilderStagingDebug
Task :app:mergeProjectDexStagingDebug
Task :app:mergeStagingDebugGlobalSynthetics
Task :app:processStagingDebugJavaRes

Task :app:kaptGenerateStubsStagingDebugAndroidTestKotlin
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.

Task :app:mergeStagingDebugJavaResource
Task :app:kaptStagingDebugAndroidTestKotlin
Task :app:packageStagingDebug
Task :app:createStagingDebugApkListingFileRedirect
Task :app:compileStagingDebugAndroidTestKotlin
Task :app:compileStagingDebugAndroidTestJavaWithJavac
Task :app:dexBuilderStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestGlobalSynthetics
Task :app:processStagingDebugAndroidTestJavaRes
Task :app:mergeProjectDexStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestJavaResource
Task :app:packageStagingDebugAndroidTest
Task :app:createStagingDebugAndroidTestApkListingFileRedirect

Task :app:pixel7Api34StagingDebugAndroidTest
Starting 50 tests on pixel7Api34

pixel7Api34 Tests 0/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 2/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 3/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 4/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 5/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 6/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 7/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 8/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 10/50 completed. (0 skipped) (0 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.CloudflareTermsConsentE2ETest > toSAlreadyAccepted_noDialogShownWhenEnablingProxy[pixel7Api34] FAILED
java.lang.AssertionError: Privacy proxy should be enabled directly when ToS already accepted
at org.junit.Assert.fail(Assert.java:89)

pixel7Api34 Tests 11/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 12/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 13/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 14/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 15/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 17/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 19/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 20/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 22/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 24/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 26/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 27/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 29/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 31/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 32/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 34/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 36/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 37/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 39/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 40/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 42/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 43/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 44/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 46/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 47/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 48/50 completed. (0 skipped) (1 failed)
pixel7Api34 Tests 50/50 completed. (0 skipped) (1 failed)
Finished 50 tests on pixel7Api34

Task :app:pixel7Api34StagingDebugAndroidTest
Tests on pixel7Api34 failed: There was 1 failure(s).

Task :app:pixel7Api34StagingDebugAndroidTest FAILED

Task :app:mergeStagingDebugAndroidTestTestResultProtos
Test execution completed. See the report at: file:///home/runner/work/Letterbox/Letterbox/app/build/reports/androidTests/managedDevice/debug/flavors/staging/allDevices/index.html
gradle/actions: Writing build results to /home/runner/work/_temp/.gradle-actions/build-results/__run_10-1768634483947.json

[Incubating] Problems report is available at: file:///home/runner/work/Letterbox/Letterbox/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:pixel7Api34StagingDebugAndroidTest'.

There were failing tests. See the report at: file:///home/runner/work/Letterbox/Letterbox/app/build/reports/androidTests/managedDevice/debug/flavors/staging/pixel7Api34/index.html

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org./

BUILD FAILED in 9m 36s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
73 actionable tasks: 73 executed
Error: Process completed with exit code 1.

Please implement fixes and test cases (mostly integration & end-to-end tests) to verify your fix & ensure comprehensive test coverage of all functionalities. Follow best practices and write idiomatic code with comprehensive test & documentation coverage, and update existing documents & create new documents for all design decisions you made during inspecting & fixing the codebase. Make sure all implementations are correct, secure, and efficient especially around the FFI boundary. Analyze carefully on performance impacts and implement the most efficient design following best practices.

Copilot AI and others added 2 commits January 17, 2026 18:11
Wait for DataStore to emit cloudflareTermsAccepted before clicking
the privacy proxy switch. This fixes the test that was failing because
collectAsState started with initial=false and the actual value wasn't
loaded yet when the switch was clicked.

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Replace Thread.sleep with composeTestRule.mainClock.advanceTimeBy()
for more deterministic test behavior. Also avoid runBlocking inside
waitUntil loop.

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot The Android UI testing CI failed. Please properly address the issues in the failed CI run as well as any potential issues that could arise in future CI/test case steps once the current issue...

Fixed in commits ff92d11 and 1be8de0.

Root Cause: The test toSAlreadyAccepted_noDialogShownWhenEnablingProxy was failing due to a race condition. The UI uses collectAsState(initial = false) for cloudflareTermsAccepted, which means it starts with false before the DataStore emits the actual stored value (true). When the test clicked the switch before the actual value was emitted, the condition !cloudflareTermsAccepted evaluated to true, incorrectly showing the ToS dialog.

Fix: Added proper waiting for Compose state to settle:

  • Use mainClock.advanceTimeBy() instead of Thread.sleep() for deterministic test timing
  • Add multiple waitForIdle() calls to ensure DataStore flows have emitted and Compose has recomposed with the new state

@MinecraftFuns
Copy link
Contributor

@copilot The Android UI testing CI failed. Please properly address the issues in the failed CI run as well as any potential issues that could arise in future CI/test case steps once the current issues are fixed.

Run ./gradlew pixel7Api34StagingDebugAndroidTest
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
Daemon will be stopped at the end of the build

Configure project :app
WARNING: The option setting 'android.experimental.testOptions.managedDevices.setupTimeoutMinutes=30' is experimental.
WARNING: The option setting 'android.experimental.testOptions.managedDevices.maxConcurrentDevices=1' is experimental.
WARNING: The option setting 'android.testoptions.manageddevices.emulator.gpu=swiftshader_indirect' is experimental.
Version Info: name=v0.0.6-dev.31+1be8de0, code=3103, stable=false, buildType=LOCAL

Task :app:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :app:cargoNdkBuild SKIPPED
Task :app:preBuild UP-TO-DATE
Task :app:preStagingDebugBuild UP-TO-DATE
Task :app:generateStagingDebugBuildConfig
Task :app:checkStagingDebugAarMetadata
Task :app:generateStagingDebugResValues
Task :app:mapStagingDebugSourceSetPaths
Task :app:generateStagingDebugResources
Task :app:packageStagingDebugResources
Task :app:mergeStagingDebugResources
Task :app:createStagingDebugCompatibleScreenManifests
Task :app:extractDeepLinksStagingDebug
Task :app:parseStagingDebugLocalResources
Task :app:processStagingDebugMainManifest
Task :app:processStagingDebugManifest
Task :app:processStagingDebugManifestForPackage
Task :app:javaPreCompileStagingDebug
Task :app:preStagingDebugAndroidTestBuild SKIPPED
Task :app:processStagingDebugAndroidTestManifest
Task :app:generateStagingDebugAndroidTestBuildConfig
Task :app:checkStagingDebugAndroidTestAarMetadata
Task :app:generateStagingDebugAndroidTestResValues
Task :app:mapStagingDebugAndroidTestSourceSetPaths
Task :app:generateStagingDebugAndroidTestResources
Task :app:javaPreCompileStagingDebugAndroidTest
Task :app:mergeStagingDebugShaders
Task :app:compileStagingDebugShaders NO-SOURCE
Task :app:generateStagingDebugAssets UP-TO-DATE
Task :app:mergeStagingDebugAndroidTestResources
Task :app:mergeStagingDebugAssets
Task :app:compressStagingDebugAssets
Task :app:desugarStagingDebugFileDependencies
Task :app:checkStagingDebugDuplicateClasses
Task :app:processStagingDebugAndroidTestResources
Task :app:mergeStagingDebugJniLibFolders
Task :app:processStagingDebugResources
Task :app:mergeLibDexStagingDebug
Task :app:mergeStagingDebugNativeLibs

Task :app:stripStagingDebugDebugSymbols
Unable to strip the following libraries, packaging them as they are: libandroidx.graphics.path.so, libboringtun-4bcc3f0a8d059b65.so, libdatastore_shared_counter.so, libjnidispatch.so, libletterbox_core.so, libletterbox_proxy.so.

Task :app:validateSigningStagingDebug
Task :app:writeStagingDebugAppMetadata
Task :app:writeStagingDebugSigningConfigVersions
Task :app:mergeStagingDebugAndroidTestShaders
Task :app:compileStagingDebugAndroidTestShaders NO-SOURCE
Task :app:generateStagingDebugAndroidTestAssets UP-TO-DATE
Task :app:mergeStagingDebugAndroidTestAssets
Task :app:compressStagingDebugAndroidTestAssets
Task :app:checkStagingDebugAndroidTestDuplicateClasses
Task :app:desugarStagingDebugAndroidTestFileDependencies
Task :app:mergeLibDexStagingDebugAndroidTest
Task :app:mergeExtDexStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestJniLibFolders
Task :app:mergeStagingDebugAndroidTestNativeLibs NO-SOURCE
Task :app:stripStagingDebugAndroidTestDebugSymbols NO-SOURCE
Task :app:validateSigningStagingDebugAndroidTest
Task :app:writeStagingDebugAndroidTestSigningConfigVersions

Task :app:kaptGenerateStubsStagingDebugKotlin
e: The daemon has terminated unexpectedly on startup attempt #1 with error code: 0. The daemon process output:
1. Kotlin compile daemon is ready

Task :app:mergeExtDexStagingDebug

Task :app:kaptGenerateStubsStagingDebugKotlin
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.

Task :app:kaptStagingDebugKotlin
Task :app:pixel7Api34Setup
Task :app:compileStagingDebugKotlin
Task :app:compileStagingDebugJavaWithJavac
Task :app:bundleStagingDebugClassesToCompileJar
Task :app:dexBuilderStagingDebug
Task :app:mergeProjectDexStagingDebug
Task :app:mergeStagingDebugGlobalSynthetics
Task :app:processStagingDebugJavaRes

Task :app:kaptGenerateStubsStagingDebugAndroidTestKotlin
w: Kapt currently doesn't support language version 2.0+. Falling back to 1.9.

Task :app:mergeStagingDebugJavaResource
Task :app:kaptStagingDebugAndroidTestKotlin
Task :app:packageStagingDebug
Task :app:createStagingDebugApkListingFileRedirect
Task :app:compileStagingDebugAndroidTestKotlin
Task :app:compileStagingDebugAndroidTestJavaWithJavac
Task :app:dexBuilderStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestGlobalSynthetics
Task :app:processStagingDebugAndroidTestJavaRes
Task :app:mergeProjectDexStagingDebugAndroidTest
Task :app:mergeStagingDebugAndroidTestJavaResource
Task :app:packageStagingDebugAndroidTest
Task :app:createStagingDebugAndroidTestApkListingFileRedirect

Task :app:pixel7Api34StagingDebugAndroidTest
Starting 50 tests on pixel7Api34

pixel7Api34 Tests 1/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 2/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 4/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 5/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 6/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 7/50 completed. (0 skipped) (0 failed)
pixel7Api34 Tests 8/50 completed. (0 skipped) (0 failed)

Task :app:pixel7Api34StagingDebugAndroidTest

org.joefang.letterbox.BackNavigationTest > backNavigation_fromHistoryEntry_returnsToList[pixel7Api34] FAILED

pixel7Api34 Tests 9/50 completed. (0 skipped) (1 failed)
Finished 9 tests on pixel7Api34

Task :app:pixel7Api34StagingDebugAndroidTest
Tests on pixel7Api34 failed: There was 1 failure(s).
Test run failed to complete. Instrumentation run failed due to Process crashed.

Task :app:pixel7Api34StagingDebugAndroidTest FAILED

Task :app:mergeStagingDebugAndroidTestTestResultProtos
Test execution completed. See the report at: file:///home/runner/work/Letterbox/Letterbox/app/build/reports/androidTests/managedDevice/debug/flavors/staging/allDevices/index.html
gradle/actions: Writing build results to /home/runner/work/_temp/.gradle-actions/build-results/__run_10-1768679098172.json

[Incubating] Problems report is available at: file:///home/runner/work/Letterbox/Letterbox/build/reports/problems/problems-report.html
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:pixel7Api34StagingDebugAndroidTest'.

There were failing tests. See the report at: file:///home/runner/work/Letterbox/Letterbox/app/build/reports/androidTests/managedDevice/debug/flavors/staging/pixel7Api34/index.html

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to generate a Build Scan (Powered by Develocity).
Get more help at https://help.gradle.org./

Deprecated Gradle features were used in this build, making it incompatible with Gradle 10.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

BUILD FAILED in 4m 14s
For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
73 actionable tasks: 73 executed
Error: Process completed with exit code 1.

Please implement fixes and test cases (mostly integration & end-to-end tests) to verify your fix & ensure comprehensive test coverage of all functionalities. Follow best practices and write idiomatic code with comprehensive test & documentation coverage, and update existing documents & create new documents for all design decisions you made during inspecting & fixing the codebase. Make sure all implementations are correct, secure, and efficient especially around the FFI boundary. Analyze carefully on performance impacts and implement the most efficient design following best practices.

Copilot AI and others added 2 commits January 17, 2026 21:10
…eliability

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 17, 2026

@copilot The Android UI testing CI failed. Please properly address the issues in the failed CI run as well as any potential issues that could arise in future CI/test case steps once the current issue...

Fixed in commits f250b41 and 36a5312.

Root Causes Addressed:

  1. Process crash: Added FLAG_ACTIVITY_NEW_TASK to all startActivity calls in WebView to prevent crashes when starting activities from non-Activity contexts
  2. BackNavigationTest reliability: Added waitForIdle() calls between activity scenario transitions to ensure database writes complete before launching the next activity

Code Improvements:

  • Extracted helper functions (openUrlInBrowser, openMailtoLink) to reduce duplication in link handling code

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