ItemListJobImpl silently throws away items that fail client side validation

Bug #1644577 reported by James Henstridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
storage-framework (Ubuntu)
Fix Released
Critical
Michi Henning

Bug Description

I spent ages trying to work out why my roots() method was appearing to succeed but never emitting the itemsReceived() signal on the ItemJob.

Inside the class, you have:

            try
            {
                validate_(md);
                auto item = ItemImpl::make_item(method_, md, account_impl_);
                items.append(item);
            }
            catch (StorageError const& exc)
            {
                // Bad metadata received from provider, validate_() or make_item() have logged it.
            }

So items that fail the validation silently disappear with no indication that there is a problem. Unlike what the comment says, there was no logging and the ItemJob didn't transition to the Error state. This is not okay.

And later on, it seems the itemsReceived signal is only conditionally emitted:

        if (!items.isEmpty())
        {
            Q_EMIT public_instance_->itemsReady(items);
        }

Would it be a problem to always emit this signal? Having it conditional like this made me chase my tail trying to work out if there was a problem with the way I'd connected to the signal, or if it might be getting emitted after statusChanged.

Related branches

Changed in storage-framework (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Michi Henning (michihenning)
status: New → In Progress
Changed in storage-framework (Ubuntu):
status: In Progress → Fix Committed
Changed in storage-framework (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.