Merge lp://staging/~alecu/ubuntuone-client/restrain-out-of-space-dialog into lp://staging/ubuntuone-client

Proposed by Alejandro J. Cura
Status: Rejected
Rejected by: dobey
Proposed branch: lp://staging/~alecu/ubuntuone-client/restrain-out-of-space-dialog
Merge into: lp://staging/ubuntuone-client
Diff against target: 364 lines (+181/-20)
4 files modified
gsd-plugin/gsd-ubuntuone.c (+82/-19)
gsd-plugin/gsd-ubuntuone.h (+3/-0)
gsd-plugin/test-flood.py (+95/-0)
nautilus/test-contacts-picker.c (+1/-1)
To merge this branch: bzr merge lp://staging/~alecu/ubuntuone-client/restrain-out-of-space-dialog
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
Natalia Bidart (community) fieldtest Approve
Roberto Alsina (community) Approve
Review via email: mp+45317@code.staging.launchpad.net

Commit message

show out-of-space dialog with an interval stored in gconf, 0 to disable (fixes LP:#650671)

Description of the change

show out-of-space dialog with an interval stored in gconf, 0 to disable

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

I agree with the idea, and the code looks ok to me. I think this is the best solution we can provide currently. I didn't fieldtest it though.

review: Approve
Revision history for this message
Alejandro J. Cura (alecu) wrote :

How to test this code:

First let's build the branch:
    cd $HOME/canonical/ubuntuone-client
    bzr branch lp:ubuntuone-client review_restrain-out-of-space-dialog
    cd review_restrain-out-of-space-dialog
    bzr merge lp:~alecu/ubuntuone-client/restrain-out-of-space-dialog
    gnome-autogen.sh && make

now let's make sure that syncdaemon is stopped, because the testing script will take its d-bus spot:
    u1sdtool -q

let's start up the testing script:
    cd gsd-plugin
    ./test-flood.py

The dialog will very quickly go thru three different messages. But since it keeps popping up, changing the messages but keeping popping up, that means that the bug was reproduced. Now let's replace the plugin with the one we just compiled. In a different terminal do:

    cd /usr/lib/gnome-settings-daemon-2.0
    sudo mv libubuntuone.so old.libubuntuone.so
    sudo ln -s $HOME/canonical/ubuntuone-client review_restrain-out-of-space-dialog/gsd-plugin/.libs/libubuntuone.so
    killall gnome-settings-daemon # your gnome settings will melt. Don't worry!
    gnome-settings-daemon --debug --no-daemon

Now go back to the first terminal and run the testing script again. It should now only show each message once every hour! The events should still be logged on the gnome-settings-daemon debug output.

Since we don't want you to waste a whole hour, let's open gconf-editor and change this (newly created) gconf key:
* /apps/gnome_settings_daemon/plugins/ubuntuone/out_of_space_warnings_interval

it should say 3600; let's change it to 10 and test the script again. (no need to restart g-s-d) Now the messages should take turns, but each message won't repeat more than every 10 seconds.

Finally, we can change that value to 0, and if you run the script no new messages should pop up at all.

You may now kill that g-s-d and start it again in the background:
 * killall gnome-settings-daemon ; sleep 3; gnome-settings-daemon

Revision history for this message
Alejandro J. Cura (alecu) wrote :

I made a mistake on a line above. Here's how it should look like:

sudo ln -s $HOME/canonical/ubuntuone-client/review_restrain-out-of-space-dialog/gsd-plugin/.libs/libubuntuone.so .

Revision history for this message
dobey (dobey) wrote :

This seems like an overly complex stopgap 'solution' to the issue. I think the proper fix would be simpler code, and it certainly wouldn't require more incorrect usage of gconf.

I would only show the dialog once per session, unless the quota limit has changed since the message was shown. This way, if there are pending uploads, and the user never upgrades, then at most, they should only get shown the dialog once at log-in time; unless their quota was increased and they hit the new limit, or gnome-settings-daemon crashes (which is a larger bug and possibly not ours).

review: Disapprove
Revision history for this message
dobey (dobey) wrote :

Sigh. :(

review: Abstain
793. By Alejandro J. Cura

GTK_DIALOG_NO_SEPARATOR has been deprecated in GTK+ 2.22 and will be removed in GTK+ 3

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

The code makes sense though I'm not an experienced gnome dev. Works like a charm.

review: Approve (fieldtest)
Revision history for this message
dobey (dobey) wrote :

Part of the problem is also that the dialog is destroyed and shown again, even if it's already shown. Instead it needs to be in a static variable, and if already shown, simply presented again.

review: Needs Fixing
794. By Alejandro J. Cura

only nag once per day

Revision history for this message
Roberto Alsina (ralsina) wrote :

rodney: that's for another bug, isn't it?

Revision history for this message
Roberto Alsina (ralsina) wrote :

> Part of the problem is also that the dialog is destroyed and shown again, even
> if it's already shown. Instead it needs to be in a static variable, and if
> already shown, simply presented again.

Now replying the right way ;-)

That's not the issue in this bug. You can add another for that and assign it to alecu or yourself, if you want.

Revision history for this message
Alejandro J. Cura (alecu) wrote :

> Part of the problem is also that the dialog is destroyed and shown again, even
> if it's already shown. Instead it needs to be in a static variable, and if
> already shown, simply presented again.

That's a valid point, but it's not something that's being done on this branch.
Would you mind opening a different bug for it?

Revision history for this message
dobey (dobey) wrote :

I'm not sure it's necessarily another bug entirely. Rather, after a little bit more thought, I think it is part of the fundamental flaw in the code that leads to this issue.

With 3000 files say, that would cauase the dialog to appear, instead of just show()ing the same dialog 3000 times, it is instead destroyed and then created again, over and over. This means it creates a state of constant flicker until the last display of the dialog, and the action happens fast enough that the user can't click "Cancel" in the middle. Destroying and creating the dialog so many times and so fast, consumes a lot of resources. While this isn't necessarily the primary fundamental flaw, I think it exposes another flaw. That is the code does not wait for all the events to coalesce, so that only one dialog is shown, at the end of the spam of messages from DBus.

While not necessarily a total fix, I do think it would be better than this patch, and be more of a step in the right direction for the total fix. And since the real target of this fix is an SRU for Maverick, I do think we need to exercise more caution in deciding what goes in, and try to minimize the change set before rushing it in.

Revision history for this message
dobey (dobey) wrote :

Changing this back to disapprove, and marking as rejected, since I proposed a better solution which is now approved.

review: Disapprove

Unmerged revisions

794. By Alejandro J. Cura

only nag once per day

793. By Alejandro J. Cura

GTK_DIALOG_NO_SEPARATOR has been deprecated in GTK+ 2.22 and will be removed in GTK+ 3

792. By Alejandro J. Cura

include the bug number in the branch

791. By Alejandro J. Cura

show out-of-space dialog with an interval, 0 to disable

790. By Alejandro J. Cura

disable dialog by a checkbox

789. By Alejandro J. Cura

use a gconf-client for the plugin

788. By Alejandro J. Cura

show each message only once per hour

787. By Alejandro J. Cura

was never shown recently

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches