Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 5, 2026

DuckDuckGo Proxy Removal and WireGuard Proxy Testing

Summary

This PR removes the legacy DuckDuckGo image proxy completely and transitions to the WireGuard-based WARP proxy architecture. All URL rewriting functionality has been removed as it's no longer needed.

Changes

  • Remove URL Rewriting Functionality

    • Remove rewrite_image_urls function from letterbox-core
    • Remove urlencoding dependency (no longer needed)
    • Remove all rewriteImageUrls tests from HtmlImageProcessingTest.kt
    • Remove DUCKDUCKGO enum value from ProxyMode
  • Fix Build Failures

    • Fix reserved _ variable names in ImageProxyTest.kt
  • Add Comprehensive Tests

    • 64 tests in letterbox-proxy
    • 36 tests in letterbox-core
    • Total: 100 Rust tests passing
    • Kotlin tests for extractRemoteImages and proxy FFI
  • Update Documentation

    • remote-images.md - consistent technical tone
    • troubleshooting.md - clarity improvements
    • letterbox-proxy/README.md - table formatting

Test Results

  • ✅ Rust letterbox-core: 36 tests passing, no warnings
  • ✅ Rust letterbox-proxy: 64 tests passing
  • ✅ Build completes without deprecation warnings
Original prompt

Your task is to clean up the codebase. Remove the DuckDuckGo image proxy that's been replaced by the new WireGuard based image proxy, add test cases around the new image proxy in both Rust and Kotlin, and clean up unused code scattered around the codebase. Follow best practices in both Rust and Kotlin. Write efficient and high performance code. Optimize around the FFI boundary. Write comprehensive tests (unit+integration+end-to-end) to pin down the exact behavior of the app and quality-control the release process (e.g. missing libraries due to packaging issues, regressions/crashes). Use sophiscated EML test cases with external images to ensure the correctness in complex cases. Write &maintain clean documentations especially on the new design choices you made, while also update the existing documentation to match the latest code behavior.


💡 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 changed the title [WIP] Clean up codebase and remove DuckDuckGo image proxy Remove DuckDuckGo proxy, add WARP proxy tests, clean up codebase Jan 5, 2026
Copilot AI requested a review from MinecraftFuns January 5, 2026 09:19
@MinecraftFuns
Copy link
Contributor

@copilot 1. please remove the “Rewrite URL” functionality along with its documentation and tests since we have moved forward with the WireGuard-based proxy approach that doesn’t rely on changing the URL to a proxy endpoint. This should also address the deprecation warning
2. please address the following build failure:

Compiling spin v0.5.2
Compiling ip_network_table-deps-treebitmap v0.5.0
Compiling allocator-api2 v0.2.21
Compiling is_terminal_polyfill v1.70.2
Compiling foldhash v0.1.5
Compiling ip_network v0.4.1
Compiling anstyle-query v1.1.5
Compiling iri-string v0.7.10
Compiling colorchoice v1.0.4
Compiling untrusted v0.7.1
Compiling smoltcp v0.12.0
Compiling tower-http v0.6.8
Compiling anstream v0.6.21
Compiling ip_network_table v0.2.0
Compiling hashbrown v0.15.5
Compiling html5ever v0.29.1
Compiling selectors v0.26.0
Compiling chacha20poly1305 v0.10.1
Compiling rand_chacha v0.3.1
Compiling env_filter v0.1.4
Compiling cookie_store v0.22.0
Compiling letterbox-proxy v0.1.0 (/home/runner/work/Letterbox/Letterbox/rust/letterbox-proxy)
Compiling hyper-rustls v0.27.7
Compiling ahash v0.8.12
Compiling x25519-dalek v2.0.0-rc.3
Compiling nix v0.25.1
Compiling blake2 v0.10.6
Compiling hmac v0.12.1
Compiling serde_urlencoded v0.7.1
Compiling http-body-util v0.1.3
Compiling futures-executor v0.3.31
Compiling hex v0.4.3
Compiling managed v0.8.0
Compiling jiff v0.2.17
Compiling base64 v0.13.1
Compiling iana-time-zone v0.1.64
Compiling boringtun v0.6.0
Compiling chrono v0.4.42
Compiling env_logger v0.11.8
Compiling scraper v0.21.0
Compiling futures v0.3.31
Compiling reqwest v0.12.28
Compiling rand v0.8.5
Compiling lru v0.12.5
Compiling webpki-roots v0.26.11
Compiling letterbox-core v0.1.0 (/home/runner/work/Letterbox/Letterbox/rust/letterbox-core)
warning: use of deprecated function rewrite_image_urls: Use letterbox-proxy crate for image fetching through WARP tunnel
--> rust/letterbox-core/src/lib.rs:770:8
|
770 | pub fn rewrite_image_urls(html: String, proxy_base_url: String) -> String {
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(deprecated)] on by default

warning: letterbox-core (lib) generated 1 warning
Finished release profile [optimized] target(s) in 1m 52s

Task :app:bundleProdDebugClassesToCompileJar UP-TO-DATE
Task :app:preProdDebugUnitTestBuild UP-TO-DATE
Task :app:javaPreCompileProdDebugUnitTest
Task :app:processProdDebugJavaRes
Task :app:buildKotlinToolingMetadata
Task :app:preProdReleaseBuild UP-TO-DATE
Task :app:generateProdReleaseBuildConfig
Task :app:generateProdReleaseResValues
Task :app:checkProdReleaseAarMetadata
Task :app:mapProdReleaseSourceSetPaths
Task :app:generateProdReleaseResources
Task :app:packageProdReleaseResources
Task :app:createProdReleaseCompatibleScreenManifests
Task :app:extractDeepLinksProdRelease
Task :app:parseProdReleaseLocalResources
Task :app:processProdReleaseMainManifest
Task :app:mergeProdReleaseResources
Task :app:processProdReleaseManifest
Task :app:preProdReleaseUnitTestBuild UP-TO-DATE
Task :app:javaPreCompileProdRelease
Task :app:preStagingDebugBuild UP-TO-DATE
Task :app:javaPreCompileProdReleaseUnitTest
Task :app:generateStagingDebugBuildConfig
Task :app:checkStagingDebugAarMetadata
Task :app:generateStagingDebugResValues
Task :app:mapStagingDebugSourceSetPaths
Task :app:generateStagingDebugResources
Task :app:packageStagingDebugResources
Task :app:processProdReleaseManifestForPackage
Task :app:parseStagingDebugLocalResources
Task :app:createStagingDebugCompatibleScreenManifests
Task :app:extractDeepLinksStagingDebug
Task :app:processStagingDebugMainManifest
Task :app:processStagingDebugManifest
Task :app:processStagingDebugManifestForPackage
Task :app:javaPreCompileStagingDebug
Task :app:preStagingDebugUnitTestBuild UP-TO-DATE
Task :app:javaPreCompileStagingDebugUnitTest
Task :app:preStagingReleaseBuild UP-TO-DATE
Task :app:generateStagingReleaseBuildConfig
Task :app:mergeStagingDebugResources
Task :app:checkStagingReleaseAarMetadata
Task :app:generateStagingReleaseResValues
Task :app:mapStagingReleaseSourceSetPaths
Task :app:generateStagingReleaseResources
Task :app:processProdReleaseResources
Task :app:processStagingDebugResources
Task :app:mergeStagingReleaseResources
Task :app:packageStagingReleaseResources
Task :app:parseStagingReleaseLocalResources
Task :app:createStagingReleaseCompatibleScreenManifests
Task :app:extractDeepLinksStagingRelease
Task :app:processStagingReleaseMainManifest
Task :app:processStagingReleaseManifest
Task :app:processStagingReleaseManifestForPackage
Task :app:processStagingReleaseResources

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

Task :app:kaptProdDebugUnitTestKotlin

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

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

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

Task :app:compileProdDebugUnitTestKotlin FAILED
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:93:13 Conflicting declarations:
local val _: Boolean
local val _: Boolean
local val _: String?
local val _: String?
local val _: UInt
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:93:13 Names _, __, ___, ... are reserved in Kotlin.
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:94:13 Conflicting declarations:
local val _: Boolean
local val _: Boolean
local val _: String?
local val _: String?
local val _: UInt
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:94:13 Names _, __, ___, ... are reserved in Kotlin.
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:95:13 Conflicting declarations:
local val _: Boolean
local val _: Boolean
local val _: String?
local val _: String?
local val _: UInt
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:95:13 Names _, __, ___, ... are reserved in Kotlin.
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:96:13 Conflicting declarations:
local val _: Boolean
local val _: Boolean
local val _: String?
local val _: String?
local val _: UInt
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:96:13 Names _, __, ___, ... are reserved in Kotlin.
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:97:13 Conflicting declarations:
local val _: Boolean
local val _: Boolean
local val _: String?
local val _: String?
local val _: UInt
e: file:///home/runner/work/Letterbox/Letterbox/app/src/test/java/org/joefang/letterbox/ffi/proxy/ImageProxyTest.kt:97:13 Names _, __, ___, ... are reserved in Kotlin.

Task :app:kaptProdReleaseKotlin
Task :app:kaptStagingDebugKotlin
Task :app:kaptStagingReleaseKotlin

FAILURE: Build failed with an exception.

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

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • 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 2m 41s

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

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.
80 actionable tasks: 60 executed, 20 up-to-date
Error: Process completed with exit code 1.

  1. please update the documentation to ensure a consistent clear, plain, technical writing tone.

Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot 1. please remove the “Rewrite URL” functionality along with its documentation and tests since we have moved forward with the WireGuard-based proxy approach that doesn’t rely on changing...

Addressed all three points in commit e0bdd40:

  1. Removed rewrite_image_urls function from letterbox-core/src/lib.rs and its tests from HtmlImageProcessingTest.kt. Also removed the urlencoding dependency which is no longer needed.

  2. Fixed the Kotlin build failure by replacing reserved _ variable names with proper named variables in ImageProxyTest.kt.

  3. Updated documentation in remote-images.md, troubleshooting.md, and letterbox-proxy/README.md with consistent technical writing tone and table formatting for readability.

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