Wordpress-android: Reader: Enable/Disable site notifications action doesn't work

Created on 19 Jan 2021  路  2Comments  路  Source: wordpress-mobile/WordPress-Android

Expected behavior

When I click on "Turn on/off site notifications" I'd expect the site notifications get enabled/disabled.

Actual behavior

When I click on "Turn on/off site notifications" nothing happens.

2021-01-19 09:31:24.885 8257-8509/org.wordpress.android.beta E/SQLiteDatabase: Error inserting SHOULD_EMAIL_COMMENTS=false BLOG_NAME=Writing Rhymes SUBSCRIPTION_ID=617136108 FEED_ID=83396915 URL=http://writingrhymes.wordpress.com SHOULD_NOTIFY_POSTS=false BLOG_ID=107850799 EMAIL_POSTS_FREQUENCY=instantly SHOULD_EMAIL_POSTS=true android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: SubscriptionModel.FEED_ID, SubscriptionModel.URL (code 2067 SQLITE_CONSTRAINT_UNIQUE) at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1701) at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1570) at com.yarolegovich.wellsql.InsertQuery.execute(InsertQuery.java:61) at org.wordpress.android.fluxc.persistence.AccountSqlUtils.updateSubscriptions(AccountSqlUtils.java:147) at org.wordpress.android.fluxc.store.AccountStore.updateSubscriptions(AccountStore.java:1307) at org.wordpress.android.fluxc.store.AccountStore.onAccountAction(AccountStore.java:912) at org.wordpress.android.fluxc.store.AccountStore.onAction(AccountStore.java:818) at java.lang.reflect.Method.invoke(Native Method) at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:507) at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:501) at org.greenrobot.eventbus.AsyncPoster.run(AsyncPoster.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)

Steps to reproduce the behavior

  1. Open Reader
  2. Open Following tab
  3. Click on the more menu icon on one of the posts
  4. Click on "Turn on site notifications"
  5. Notice the error in the logcat, also notice the notifications don't get enabled
Tested on [device], Android [version], WPAndroid [version]

Emulator API 30

Reader [Type] Bug

All 2 comments

I tested with 16.5-rc-2 and I was able to use the "Turn on site notifications" option to subscribe to new posts for a blog.

Please ignore this note if the bug is in develop only and you already knew that!

Video: 1m12s
Tested with WPAndroid 16.5-rc-1 on Pixel 3 Android 11 logged in as testuser0313 and tapping "Turn on site notifications" for a WordPress.com Free site.

image image

74 - [Jan-20 01:11 STATS] 馃數 Tracked: reader_accessed
75 - [Jan-20 01:11 MAIN] ReaderTracker: started MAIN_READER
76 - [Jan-20 01:11 READER] reader post list > resumed from paused state
77 - [Jan-20 01:11 READER] reader posts task already running
78 - [Jan-20 01:11 READER] TRACK READER ReaderPostListFragment > START Count [mIsTopLevel = true]
79 - [Jan-20 01:11 STATS] 馃數 Tracked: reader_following_shown
80 - [Jan-20 01:11 STATS] 馃數 Tracked: post_card_more_tapped
81 - [Jan-20 01:11 STATS] 馃數 Tracked: followed_blog_notifications_reader_menu_on, Properties: {"blog_id":9642953}
82 - [Jan-20 01:11 API] Dispatching action: AccountAction-UPDATE_SUBSCRIPTION_NOTIFICATION_POST
83 - [Jan-20 01:11 API] Dispatching action: AccountAction-UPDATED_SUBSCRIPTION
84 - [Jan-20 01:11 API] Dispatching action: AccountAction-FETCH_SUBSCRIPTIONS
85 - [Jan-20 01:11 API] Dispatching action: AccountAction-FETCH_SUBSCRIPTIONS
86 - [Jan-20 01:11 API] Dispatching action: AccountAction-FETCHED_SUBSCRIPTIONS
87 - [Jan-20 01:11 API] Dispatching action: AccountAction-FETCHED_SUBSCRIPTIONS
88 - [Jan-20 01:12 UTILS] trackLastActivity, activityId: My Site
89 - [Jan-20 01:12 STATS] 馃數 Tracked: my_site_tab_accessed, Properties: {"blog_id":5276229,"site_type":"blog","is_jetpack":false}
90 - [Jan-20 01:12 READER] TRACK READER ReaderPostListFragment > STOP Count [mIsTopLevel = true]
91 - [Jan-20 01:12 MAIN] ReaderTracker: stopped MAIN_READER

Thanks for testing @designsimply! That's quite weird, I tested it on two different accounts + two different devices + both develop and alpha-267. It doesn't work for me.
Tbh I haven't checked if it actually subscribes me on the server. However, the "Turn on site notifications" item should change to "Turn off site notifications", which doesn't happen (It keeps showing "Turn on site notifications" item + I can see the error in the log).

Was this page helpful?
0 / 5 - 0 ratings