Skip to content
This repository has been archived by the owner on Jan 23, 2019. It is now read-only.

Text is lost after pressing Next when completely replacing a previous string #113

Closed
vit1-irk opened this issue Jul 10, 2017 · 8 comments
Closed

Comments

@vit1-irk
Copy link

Steps to reproduce:

  1. Try to translate a string
  2. Push "next" button
  3. Try to go back
  4. See that all of the text you typed before is gone

Workaround behavior to avoid such a thing is to switch focus to original string and back to translated one then press "next". But it takes time and finger effort.

P.S. Using Android 7.1 (Lineage OS)

@Lonami
Copy link
Member

Lonami commented Jul 10, 2017

Try to go back

Back as in pressing the back button or the "previous" button?

@vit1-irk
Copy link
Author

Previous button

@Lonami
Copy link
Member

Lonami commented Aug 2, 2017

Can't reproduce the issue. Are you using the latest version?:

cannot-reproduce

@vit1-irk
Copy link
Author

vit1-irk commented Aug 2, 2017

Yes, I've updated Stringlate recently and the bug still remains.

You have to try typing and navigating more times to reproduce this. I noticed that chances to catch the bug are increasing if translation process goes faster, but it's unpredictable.

@vit1-irk
Copy link
Author

vit1-irk commented Aug 2, 2017

Yay, managed to capture bug on video!
You can see that the "Next" string is gone at the end.

The steps to reproduce are going now this way:

  1. Enter some text
  2. Go "Next" button
  3. Enter some more text
  4. Go "Previous"
  5. Replace some text maybe
  6. Go "Next"
  7. Go "Previous"

So the text entered in step 5 is completely lost

@ptrcnull
Copy link
Contributor

ptrcnull commented Aug 3, 2017

Can confirm.

@Lonami
Copy link
Member

Lonami commented Aug 7, 2017

Okay I got this it seems to happen when you replace the whole string (i.e. first delete all its contents and then add more), not when you simply remove a portion of it.

@Lonami Lonami changed the title [Bug] Sometimes app is "losing" entered text after pressing "Next" Text is lost after pressing Next when completely replacing a previous string Aug 7, 2017
@Lonami Lonami closed this as completed in d958d21 Aug 7, 2017
@Lonami
Copy link
Member

Lonami commented Aug 7, 2017

The fact it had to be an empty string was key :)

getTag() would cache the result, but after setting a string
to empty content, the cached result wouldn't be invalidated.

This caused some operations to update the contents of a now
ghost tag, hence losing the changes when updating the cache.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants