Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

large message bubble backgrounds fail to render

Open BP602 opened this issue 11 years ago • 18 comments

Message doesn't show when sent and has no background when received.

screenshot_2015-05-10-18-18-34 screenshot_2015-05-10-18-18-49

Its seems to be specific to this piece of text, although it could be length related:

Rêve :
- Big fish de Tim Burton
"un homme raconte si souvent ses histoires qu'il ne finit par ne faire plus qu'un avec ses histoires et ainsi il devient immortel"

- "Utopie" de Thomas More 

- Gustave Thibon "Faire rêver les hommes est le plus sûr moyen de les tenir endormis" 

- Jeanne Bernis "L'imagination" le manque, l'éloignement rend désirable, la cristallisation, le rêve est trompeur et engendre des désillusions, sublime la realite

- Freud : "Le bonheur est un rêve d'enfant réalisé à l'âge adulte
" Tout rêve est réalisation de désir"
"Le rêve ne pense ni ne calcule, d'une manière générale il ne juge pas, il se contente de transformer"

- Paulo Coelho :" C'est la possibilité de réaliser un rêve qui rend la vie interessante"

- Vera Wong : "Princess" - Jeune fille habillé en princesse pour un parfum, fait rêver 

- Raymond Trousson : "Le ver est dans le fruit" ,  monde uniforme, tout est contrôlé, révèle l'anti-utopie 

- Le seigneur des anneaux 


Objet : 
- Antoine de Saint-Exupery : "Ce n'est point dans l'objet que réside le sens des choses mais dans la démarche" 

- Fight Club de D.Fincher- 1999 - Scene de la rêverie autour du catalogue Ikea

- Gran Torino -  Clint Eastwood -  2008 - que léguer et à qui léguer. 

- Émile Zola "L'assomoir" - La machine et l'homme dans l'industrie, personnification de l'objet (Marteau) 

- Wall-E- Andrew Stanton 

- Alexandro Zinna "L'objet et ses interfaces"- une différence entre l'objet utile(uniforme, usine) et l'objet esthétique (unique, artisanal). Les deux tendent parfois à se rapprocher 

-" Le bonheur c'est de continuer à désirer ce que l'on possède" Saint Augustin 

- Marie Piquemal "Ils ont décidé de vivre avec cent objets"-Liberation

Device info: HTC one M7 GE, stock android 5.0.1, TextSecure 2.14.1 Debug log: https://gist.github.com/anonymous/5d33a6dac7f6873495fd

BP602 avatar May 10 '15 16:05 BP602

Tried to reproduce this with the given text using different themes and languages but failed. TS 2.14.1 stock Android 5.1, Nexus 4 Android 4.0.4, Huawei U8800

I don't get any of those OpenGLRenderer warnings.

2-4601 avatar May 10 '15 19:05 2-4601

Seems like this can be caused when rendering large TextViews - http://stackoverflow.com/questions/27444387/issue-on-openglrenderer-path-too-large-to-be-rendered-to-a-texture. Might need to set the layerType to software to mitigate, because this is a new device so I doubt it's a legacy problem.

mcginty avatar May 10 '15 23:05 mcginty

I can reproduce it on a LG g2, Cyanogen/Stock Android 5.0.2, TextSecure ~~2.14.1~~ 2.13

BP602 avatar May 11 '15 00:05 BP602

@5boro I'm assuming this is not a consistent thing, and is just with this specifically long text?

mcginty avatar May 11 '15 01:05 mcginty

It is consistent, but seems specific to this text. Debug log for the LG g2 : https://gist.github.com/anonymous/d45a79c0b0a1c469436b

BP602 avatar May 11 '15 16:05 BP602

I just noticed that the text in written in white over white background, so the bug is just that there's no background either when sent or received with this text.

BP602 avatar May 12 '15 20:05 BP602

might be related to #3134 (white cursor)?

agrajaghh avatar May 12 '15 21:05 agrajaghh

Just tried a few things, it is length related, and the limit seems to be between 750 and 1000 characters. The text was over 1700.

BP602 avatar May 12 '15 21:05 BP602

It's not the number of chars, but the number of lines! If the background is visible for you, just feed some/many/a big amount of line breaks and the background gets veeery transparent.

Tested on dark theme. no blue bubble background, but visible white characters on black background. As on dark theme sender and receiver text color is white <> light theme sender:white, receiver:black

McLoo avatar May 12 '15 21:05 McLoo

Good catch, but why wasn't @2-4601 able to reproduce it?

BP602 avatar May 12 '15 21:05 BP602

@5boro cause copying your text sample here eliminates all the line breaks, when pasted into TS - At least when I was testing.

McLoo avatar May 14 '15 05:05 McLoo

I saved the text (with all 39 lines) to a file and copypasted it to TextSecure from there.

2-4601 avatar May 14 '15 09:05 2-4601

Are you on Android >5 @McLoo ? Because I had the occasion to test it on a few of my friends phone, 2 Galaxy S5 and a Meizu MX3, all were on Kitkat, and the bug wasn't reproducing.

BP602 avatar May 14 '15 12:05 BP602

I can reproduce this now on my Nexus 4, stock Lollipop 5.1. It requires 106 or more line breaks (I had also one character/byte on each line when testing).

Here's a debug log where I

  • send a message with 105 line breaks and it renders correctly
  • check that the log contains no OpenGLRenderer warnings
  • send another message with 106 line breaks and the rendering breaks

2-4601 avatar May 14 '15 17:05 2-4601

Thanks for the testing all. My guess is that the line-number threshold to set off this error is variable depending on what the device decides is its max OpenGL texture size.

mcginty avatar May 14 '15 23:05 mcginty

Yeah, any bubble > 4096px will cause this error, whether we set the LayerType to software or hardware.

Even more strangely, if we use a ColorDrawable or RectShape drawable instead of a GradientDrawable or RoundedRectShape drawable, this error doesn't happen. It appears Android doesn't handle rounded corners efficiently, making me wonder if we're better off using nine-patches instead of shape drawables for them.

mcginty avatar May 19 '15 02:05 mcginty

Basically we need to not use our own shape-based drawables and move to 9patches. I started the process, but there's a lot of busywork for asset generation and re-aligning stuff.

mcginty avatar May 19 '15 22:05 mcginty

Fixed in 2.21.0

mcginty avatar Jul 02 '15 22:07 mcginty