Skip to content

[BugFix][Android] Reject unsafe Lynx viewport threading - #127

Open
Huxpro wants to merge 1 commit into
tiktok:agent/android-failed-view-retryfrom
Huxpro:agent/android-viewport-thread-guard
Open

[BugFix][Android] Reject unsafe Lynx viewport threading#127
Huxpro wants to merge 1 commit into
tiktok:agent/android-failed-view-retryfrom
Huxpro:agent/android-viewport-thread-guard

Conversation

@Huxpro

@Huxpro Huxpro commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • reject fixed Lynx viewport plus MULTI_THREADS before Activity launch or Lynx view construction
  • resolve page and global thread-strategy precedence before validating the combination
  • preserve all fixed-viewport and multi-thread configurations that are safe independently
  • expose a Java-friendly typed configuration error and document the rule in English and Chinese

Why

Android Sandbox comparison reproduced the same native liblynx.so layout SIGSEGV through both Sparkling and a direct raw LynxViewBuilder. Setter order changed timing but was not a reliable workaround. Rejecting this one known-unsafe combination prevents a process crash until the shared Lynx SDK/core race is fixed.

Stack

Test Plan

  • SG1 focused unit suite: 35 tests, 0 failures/errors/skips
  • PATH=/tmp/sparkling-ktlint-bin:$PATH scripts/lint.sh kotlin
  • Android Sandbox typed rejection and safe-control gate will be attached after the PR is created

Android Sandbox Evidence

  • Sandbox aries_10, Android 10/API 29, arm64-v8a
  • OK (2 tests), INSTRUMENTATION_CODE: -1
  • unsafe fixed viewport + MULTI_THREADS: typed FIXED_VIEWPORT_WITH_MULTI_THREADS before launch; startActivity count remained 0
  • safe fixed viewport + PART_ON_LAYOUT: real 88,577-byte bundle reached first screen/load finish; measured and layout size 320x480; underlying LynxView strategy PART_ON_LAYOUT
  • strict verifier: PASS
  • evidence archive SHA-256: 3e2c12b2d025fc0853c64c936976dbfa2b591204907652ac4ebc8f95e440ffd5

Expanded durable device validation

The checked-in SG1 + Lynx Sandbox matrix in #131 now validates exact commit df875a87541d587ab8aa84a86600c0610f9e44c7 with 10/10 PASS on aries_10 (Android 10 / API 29). Added runtime coverage includes: the pre-load listener observing a ready bridge before template fetch; the global per-page fetcher factory; real first-screen rendering for ALL_ON_UI, MOST_ON_TASM, PART_ON_LAYOUT, and safe MULTI_THREADS; and full-page fixed-viewport + MULTI_THREADS rejection before Activity launch or transfer-station save. The runner requires a clean exact HEAD and fails closed unless Sandbox release confirms the leased serial. Evidence: /tmp/sparkling-android-device-acceptance-df875a8; archive SHA-256 712a3b83dbd78eabeae9afc0766b5b191cee0bff10e515967b3ae9f46c4feb98.

Summary of change:
- Reject fixed viewport and MULTI_THREADS after resolving page and global precedence.
- Fail synchronously with a Java-friendly typed configuration exception before container launch or Lynx view construction.
- Preserve existing behavior for safe thread strategy and viewport combinations.
- Document the compatibility rule and resolution order in English and Chinese.

TEST: PATH=/tmp/sparkling-ktlint-bin:$PATH scripts/lint.sh kotlin
TEST: Local focused Gradle tests did not complete because the local environment/download path timed out; validation will run against the SG1 cache.

Co-authored-by: TRAE CLI <noreply@bytedance.com>
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.

1 participant