noinnion / newsplus

News+ is a simple, fast and intuitive feed/rss reader for Android, featuring beautiful themes, podcast support and full offline support.
http://noinnion.com/newsplus
349 stars 77 forks source link

tt-rss plugin seems to "forget" authentication details #80

Open jochenberger opened 9 years ago

jochenberger commented 9 years ago

From time to time, refreshing a tt-rss subscription fails. When that happens, ERROR_AUTHENTICATION: NOT_LOGGED_IN is shown in a popup. The logcat shows

W/System.err( 9421): com.noinnion.android.reader.api.ReaderException$ReaderLoginException: NOT_LOGGED_IN
W/System.err( 9421):    at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.handleError(TtRssExtension.java:369)
W/System.err( 9421):    at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.parseFeedList(TtRssExtension.java:610)
W/System.err( 9421):    at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.getFeedList(TtRssExtension.java:576)
W/System.err( 9421):    at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.handleReaderList(TtRssExtension.java:379)
W/System.err( 9421):    at com.noinnion.android.reader.api.ReaderExtension$1.handleReaderList(ReaderExtension.java:154)
W/System.err( 9421):    at com.noinnion.android.reader.api.internal.IReaderExtension$Stub.onTransact(IReaderExtension.java:71)
W/System.err( 9421):    at android.os.Binder.execTransact(Binder.java:404)
W/System.err(32501): com.noinnion.android.reader.api.ReaderException$ReaderLoginException: ERROR_AUTHENTICATION: NOT_LOGGED_IN
W/System.err(32501):    at com.noinnion.android.newsplus.reader.provider.ReaderManager.checkError(ReaderManager.java:1069)
W/System.err(32501):    at com.noinnion.android.newsplus.reader.provider.ReaderManager.syncReaderLists(ReaderManager.java:1710)
W/System.err(32501):    at com.noinnion.android.newsplus.reader.provider.ReaderManager.sync(ReaderManager.java:1093)
W/System.err(32501):    at com.noinnion.android.newsplus.reader.provider.ReaderManager.syncEx(ReaderManager.java:1075)
W/System.err(32501):    at com.noinnion.android.newsplus.reader.service.SyncService.doSync(SyncService.java:197)
W/System.err(32501):    at com.noinnion.android.newsplus.reader.service.SyncService.access$000(SyncService.java:57)
W/System.err(32501):    at com.noinnion.android.newsplus.reader.service.SyncService$1.run(SyncService.java:139)
W/System.err(32501):    at com.noinnion.android.newsplus.extension.ExtensionHost$1.run(ExtensionHost.java:186)
W/System.err(32501):    at android.os.Handler.handleCallback(Handler.java:733)
W/System.err(32501):    at android.os.Handler.dispatchMessage(Handler.java:95)
W/System.err(32501):    at android.os.Looper.loop(Looper.java:136)
W/System.err(32501):    at android.os.HandlerThread.run(HandlerThread.java:61)

To fix it, I have to sign out of the tt-rss plugin, quit News+ via the recent apps, start it again and sign in. Then, it usually works again.

jochenberger commented 9 years ago

Sometimes, the trace also contains

W/System.err( 9421): org.json.JSONException: Value <?xml of type java.lang.String cannot be converted to JSONObject
W/System.err( 9421):    at org.json.JSON.typeMismatch(JSON.java:111)
W/System.err( 9421):    at org.json.JSONObject.<init>(JSONObject.java:159)
W/System.err( 9421):    at org.json.JSONObject.<init>(JSONObject.java:172)
W/System.err( 9421):    at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.login(TtRssExtension.java:318)
W/System.err( 9421):    at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.handleReaderList(TtRssExtension.java:385)
W/System.err( 9421):    at com.noinnion.android.reader.api.ReaderExtension$1.handleReaderList(ReaderExtension.java:154)
W/System.err( 9421):    at com.noinnion.android.reader.api.internal.IReaderExtension$Stub.onTransact(IReaderExtension.java:71)
W/System.err( 9421):    at android.os.Binder.execTransact(Binder.java:404)
noinnion commented 9 years ago

could you try the latest beta v1.1.5beta http://noinnion.com/newsplus/updates/

On Tue, Sep 9, 2014 at 7:04 PM, jochenberger notifications@github.com wrote:

Sometimes, the trace also contains

W/System.err( 9421): org.json.JSONException: Value <?xml of type java.lang.String cannot be converted to JSONObject W/System.err( 9421): at org.json.JSON.typeMismatch(JSON.java:111) W/System.err( 9421): at org.json.JSONObject.(JSONObject.java:159) W/System.err( 9421): at org.json.JSONObject.(JSONObject.java:172) W/System.err( 9421): at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.login(TtRssExtension.java:318) W/System.err( 9421): at com.noinnion.android.newsplus.extension.ttrss.TtRssExtension.handleReaderList(TtRssExtension.java:385) W/System.err( 9421): at com.noinnion.android.reader.api.ReaderExtension$1.handleReaderList(ReaderExtension.java:154) W/System.err( 9421): at com.noinnion.android.reader.api.internal.IReaderExtension$Stub.onTransact(IReaderExtension.java:71) W/System.err( 9421): at android.os.Binder.execTransact(Binder.java:404)

— Reply to this email directly or view it on GitHub https://github.com/noinnion/newsplus/issues/80#issuecomment-55002446.

jochenberger commented 9 years ago

Sorry, I don't install packages from untrusted sources. I'll report back if I have issues with the next stable release.

jochenberger commented 9 years ago

Still broken in the new version.

jochenberger commented 9 years ago

When that happens, downloading offline content for already synced items still works. The error only occurs when trying to fetch new items.

jochenberger commented 9 years ago

That usually happens at least once a day.

noinnion commented 9 years ago

sorry for the late reply. I will try to fix it.

On Tue, Oct 14, 2014 at 6:41 PM, jochenberger notifications@github.com wrote:

That usually happens at least once a day.

— Reply to this email directly or view it on GitHub https://github.com/noinnion/newsplus/issues/80#issuecomment-59076264.

moneytoo commented 9 years ago

I have the same issue (already saw it couple of times every few days when I try to read feeds using News+). Hope you can fix it.

Kasara commented 9 years ago

Hello Noinnion,

I also have that error. I think, the problem might be the "single user mode" in combination with an authentication plugin set in the ttrss config.php and by using your ttrss api plugin... Later this day I will try to remove the authentication plugins from the config.php. THIS should ONLY be done, if you are using another methode of protection (like htaccess).

Greetings

jochenberger commented 9 years ago

Still an issue in 2.0.0.

moneytoo commented 9 years ago

I experienced this issue on CyanogenMod rom but it worked fine (and still does) on stock rom (Samsung Galaxy S5).

jochenberger commented 9 years ago

I'm actually using CyanogenMod. What about you @Kasara? I still wonder why TtRssExtension tries to parse an XML (sub?)string to JSON.

noinnion commented 9 years ago

Hi Jochen,

it is possible to have access to your account? I could not reproduce the issue so it would be good to test it on your account. If it is ok, send me an email

On Thu, Jan 15, 2015 at 6:50 PM, jochenberger notifications@github.com wrote:

I'm actually using CyanogenMod. What about you @Kasara https://github.com/Kasara? I still wonder why TtRssExtension tries to parse an XML (sub?)string to JSON.

— Reply to this email directly or view it on GitHub https://github.com/noinnion/newsplus/issues/80#issuecomment-70128913.

jochenberger commented 9 years ago

Frankly spoken, I'm not a big fan of that idea. What about catching the exception and logging more of the XML string, like the first max(200, string.length() chars? Maybe that'll help us to understand what's happening and how an XML string is ending up in the JSON parser in the first place.

jochenberger commented 9 years ago

I tried to have a look myself, but when I try to import the tt-rss extension project in eclipse, I get a manifest error:

error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.Sherlock.Light').