Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

<img> wider than its rendering column fails to paint on Android — silently in isolation, with an "invalid measurement" error alongside any other text (not a decode-timing race)

Abierto
#797 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@hejsztynx ya está trabajando en esto.

Desde el 24/9/2026.

  • #807 de @hejsztynx — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
android, react-native
Área
mobile

Línea de trabajo

Comienza con MeasurementStore.measure() y la ruta de imágenes de Android que incluye AsyncDrawable e ImageDecoder.setTargetSize. Ejecuta la reproducción mínima enlazada con los tres casos de imágenes sobredimensionadas y, después, compara el comportamiento de medición de una sola línea y de varias líneas, así como el registro de mediciones no válidas. Se considera terminado cuando las imágenes sobredimensionadas ya no fallan silenciosamente ni desaparecen durante el renderizado.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Describes the bug

An <img> tag whose declared width exceeds the actual width of the column EnrichedText renders it into fails to paint on Android. This is fully deterministic — not a timing race — and reproduces on the very first cold launch, every time.

I originally filed this issue theorizing an unsynchronized bounds race in AsyncDrawable (ImageDecoder.setTargetSize reading a still-zero Rect before the text-layout pass assigns real bounds). That was a plausible read of the source, but after extensive testing (cold cache, warm cache, a local low-latency image server, and the exact resolve-then-remount sequence a real consuming app uses, run concurrently across 16 images) I was never able to reproduce it. Everything I've actually observed — including the original production bug that led me to file this — is fully explained by the mechanism below instead, with no timing element at all. Retracting that theory.

The failure takes two different shapes depending on context:

  1. The <img> is the only content in the EnrichedText — the failure is completely silent. No exception, no broken-image placeholder, nothing logged anywhere.
  2. There's any other text in the same EnrichedText (true of essentially all real admin-authored content — headings, paragraphs, etc. around an image) — the same failure now logs a concrete diagnostic:
    ReactNativeJNI: EnrichedTextView returned an invalid measurement. Min: [0,0] Max: [384,inf] Actual: [400,404.333]
    
    Max is the real available column width; Actual is what the measure function reported back, driven by the embedded image's declared size.

This split traces to MeasurementStore.measure(): single-line content reports StaticLayout.getLineWidth(0), but multi-line content reports StaticLayout.width instead — and that can still exceed the nominal wrap width when one line contains an unsplittable inline image wider than the rest.

To Reproduce

Minimal repro app: https://github.com/ekrapfl/rne-html-repro-android-img-paint

  1. npm install && npm run android (native dev build, Fabric).
  2. Three cases render: an image that fits (paints normally), the same image declared far wider than the screen with no other content (renders at full size, overflowing the screen edge uncropped), and that same oversized image with a paragraph before it (reserves no visible space, shows nothing).
  3. adb logcat | grep -i "invalid measurement" around the third case.

Expected behavior

An oversized declared width shouldn't cause total, silent render failure. At minimum, a diagnostic should surface consistently (right now it only does when there's other text in the same view); ideally the library would clamp/scale the image to the available column itself, the way a browser does with img { max-width: 100% }, rather than leaving every consumer to compute and inject a safe pixel width themselves.

Device tested

  • Pixel 10 Pro XL emulator (sdk_gphone16k_arm64), Android API 37
  • react-native-enriched-html 1.1.1, React Native 0.86.3, Expo ~57.0.23, Fabric (New Architecture)

Additional context

One honest caveat: the visual failure reproduces reliably in the minimal repro above, on a fresh cold install, every time. The exact JNI log line was confirmed repeatedly against a full production app under a matching layout structure, but hasn't fired in the standalone repro despite matching nesting depth, padding, and styling — something about the fuller app context matters there that I haven't isolated. The visual symptom (reserves no space, never paints) is the same failure either way.

Lenguaje dominante
C
Estrellas
1.4k
Forks
67
Merge medio
4 d 11 h
PR fusionados (30 d)
7

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de software-mansion/react-native-enriched-html

Todos los issues de software-mansion/react-native-enriched-html

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.