-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when applying special comments on API 26/27 #516
Comments
Found this only happens if you follow the steps above by the letter. But, if you position the cursor somewhere in the body first (by tapping before/after anything in the content area), then tapping on one of the special comments action icons works alright, inserting the desired object on the desired position. |
More info on this: this only happens if the cursor is at the very beginning of the content: tapping at the left of the first image in the Aztec demo app shows the cursor blinking, and then trying to insert something there (more, page OR horizontal ruler) makes it fail |
Confirming this happens since API 26 as well (Android 8.0.0) |
Managed to narrow this down to:
For example, in the demo app, trying to insert a Horizontal Rule right before the following content produces the crash:
However, this other content does not produce the crash (it's just the same as above without the
Still trying to gather information to see what relates |
I also managed to make it crash with the very/similar output when inserting ANY character right before the captioned image, although I believe this might be a different problem (the cause certainly looks different, although the crash is the same):
Apparently, checking the code I can avoid this crash from happening when commenting out the following piece of code, which was introduced in commit 668dcfb : If you comment out those lines, following the above steps 1-4 don’t make it crash. |
I've played around with the app and I can confirm what you mentioned above. Setting the HTML to the following will always crash:
The code above is just one of many manifestations of the same error and it's not limited to I tried a couple of things, like removing some other spans, removing and then setting the caption span but nothing worked. The only thing that did work was setting a span on a separate
It could probably work for the other case with the special comment, we'd just need to find the specific call to |
Nice find @0nko ! I'm surprised that |
I've discovered a curious situation. Try the following:
Weird eh? It seems the caption at the very beginning puts |
It is! I tend to think something is just not rightly handled with spans in the platform. Anyway, just tested on the PR branch and couldn't repro 👍 |
There's even more weird stuff
Also the undo/redo does weird stuff |
Sorry this is the content observed in step 8 above: |
Tracked by Google here: https://issuetracker.google.com/issues/67102093 |
Great - I think we may even get away without "fixing" (hacking around) it. |
Decision: we have to catch the global exception and try to recover from the crash, if it's possible at all. |
It has been fixed by Google. It will be released in the next Android version 😀. |
niiiiiiiceeee 🎉 💃 |
Fixed for now I Android 8.x via #801, closing |
Applying a special comment (more, page) results in a crash on Oreo 8.1 (API 27)
Reproduced
Tested
Emulator running API 27.
The text was updated successfully, but these errors were encountered: