marunjar / anewjkuapp

GNU General Public License v3.0
16 stars 4 forks source link

Parsing error on login - "mark invalid" #139

Closed fsteff closed 4 years ago

fsteff commented 4 years ago

On my new phone logging in is not working anymore. App Version: Master branch Device: Xiamoi Mi9T Pro OS: Android 9 (MiUi 10) So I've decided to debug it a little...

Stack Trace:

W/KusssHandler: login failed
    java.io.IOException: Mark invalid
        at org.jsoup.parser.CharacterReader.rewindToMark(CharacterReader.java:132)
        at org.jsoup.parser.Tokeniser.consumeCharacterReference(Tokeniser.java:182)
        at org.jsoup.parser.TokeniserState$38.read(TokeniserState.java:752)
        at org.jsoup.parser.Tokeniser.read(Tokeniser.java:57)
        at org.jsoup.parser.TreeBuilder.runParser(TreeBuilder.java:55)
        at org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:47)
        at org.jsoup.parser.Parser.parseInput(Parser.java:35)
        at org.jsoup.helper.DataUtil.parseInputStream(DataUtil.java:169)
        at org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:835)
        at org.voidsink.anewjkuapp.kusss.KusssHandler.login(KusssHandler.java:200)
        at org.voidsink.anewjkuapp.activity.KusssAuthenticatorActivity$LoginTask.doInBackground(KusssAuthenticatorActivity.java:195)
        at org.voidsink.anewjkuapp.activity.KusssAuthenticatorActivity$LoginTask.doInBackground(KusssAuthenticatorActivity.java:167)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:764)

This issue might be related to Jsoup #1218

My first tries show that it seems to be enough to store the stream it into a string and then parse it.

marunjar commented 4 years ago

indee this is related to https://github.com/jhy/jsoup/issues/1218, thanks for debugging. I'll also check all other calls to parse and then push a new version of the app.