Apps-android-commons: Notification does not gets archived when swiped left

Created on 15 Feb 2019  路  10Comments  路  Source: commons-app/apps-android-commons

Summary:

In notification activity when we try to archive the notification by swiping left and pressing tick, notification does not get archived, instead shows a error toast message.

Steps to reproduce:

  • Go to notification activity
  • Swipe left a notification and tap tick mark

you will see a toast saying "There was some error!"

Commons app version:
2.10.0-debug-master~b5a479ce

Would you like to work on the issue?
yes

assigned bug upstream

All 10 comments

@thomas154 can i work on this issue?

@BinduVerma123 you may proceed. Just a heads up, when I tried to resolve this issue I didn't find anything wrong with the app. So I tried to reproduce the same issue on the website turned out there too when notifications were marked as read they remained unread. Seems like something wrong on the backend side, but still you can give it a try may be I had missed something.

If there is a problem with the backend side (Mediawiki), the first thing would be to report the bug at https://phabricator.wikimedia.org
Thanks!

@thomas154 Is the issue related to archiving notifications or while marking notifications as read?

@vanshikaarora Since the activity's toolbar title name was Notification(archived) I used that word while reporting the issue, to me the intention seemed like marking the notification as read, maybe that title need to be renamed to avoid confusion.

hey! today when I tried to reproduce the same issue it worked. Notifications are now getting marked as read. :v:

the intention seemed like marking the notification as read

@thomas154 I guess earlier you have tried to swipe left, while the current feature is to mark notification as read when swiped right.

Was this the issue?

@vanshikaarora at time of creating this issue, the (2.10.0-debug-master~b5a479ce) version of app didn't had the feature to swiping right(I mean you can't swipe right a item).

//In file NotificationActivity
@SuppressLint("CheckResult")
    public void removeNotification(Notification notification) {
        Observable.fromCallable(() -> controller.markAsRead(notification))
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(result -> {
                    if (result){
                        notificationList.remove(notification);
                        setAdapter(notificationList);
                        adapter.notifyDataSetChanged();
                        Snackbar snackbar = Snackbar
                                .make(relativeLayout,"Notification marked as read", Snackbar.LENGTH_LONG);

                        snackbar.show();
                        if (notificationList.size()==0){
                            setEmptyView();
                            relativeLayout.setVisibility(View.GONE);
                            no_notification.setVisibility(View.VISIBLE);
                        }
                    }
                    else {
                        adapter.notifyDataSetChanged();
                        setAdapter(notificationList);
                        Toast.makeText(NotificationActivity.this, "There was some error!", Toast.LENGTH_SHORT).show();
                    }
                }, throwable -> {

                    Timber.e(throwable, "Error occurred while loading notifications");
                    throwable.printStackTrace();
                    ViewUtil.showShortSnackbar(relativeLayout, R.string.error_notifications);
                    progressBar.setVisibility(View.GONE);
                });
    }

    private void initListView() {
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        DividerItemDecoration itemDecor = new DividerItemDecoration(recyclerView.getContext(), DividerItemDecoration.VERTICAL);
        recyclerView.addItemDecoration(itemDecor);
        if (getIntent().getStringExtra("title").equals("read")) {
            refresh(true);
        } else {
            refresh(false);
        }
    }

From above code it seems to me that archiving and marking it as read are the same thing.
Maybe they have resolved the issue at backend side, So this issue no longer exist.

Seems to be fixed upstream now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

misaochan picture misaochan  路  4Comments

maskaravivek picture maskaravivek  路  3Comments

misaochan picture misaochan  路  3Comments

domdomegg picture domdomegg  路  3Comments

nicolas-raoul picture nicolas-raoul  路  4Comments