File emblems don't display correct sync status

Bug #479475 reported by Joshua Hoover
68
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Fix Released
Medium
Roman Yepishev
ubuntuone-client (Ubuntu)
Triaged
Medium
Unassigned
Nominated for Karmic by Joshua Hoover

Bug Description

Copying a 50 MB file to ~/Ubuntu One results in the file getting an immediate emblem of a green check mark, which is meant to represent files that are synchronized. Another test is copying a folder with five mp3 files (folder size of 26 MB) to ~/Ubuntu One and the folder and files all have the green check mark right away. This is happening on Karmic as well as Jaunty (r273)

Related branches

Changed in ubuntuone-client (Ubuntu):
status: New → Triaged
assignee: nobody → Rodney Dawes (dobey)
Revision history for this message
Roman Yepishev (rye) wrote :

The 'synchronized' emblem is added immediately and not updated later.
Here are the messages from Nautilus when an attempt is made to browse Ubuntu One directory.

UbuntuOne-Nautilus-Message: rtg: Add the synchronized emblem anyway

(nautilus:20793): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion `instance != NULL && instance->g_class != NULL' failed

** (nautilus:20793): CRITICAL **: dbus_g_proxy_begin_call: assertion `DBUS_IS_G_PROXY (proxy)' failed

Revision history for this message
Roman Yepishev (rye) wrote :

Rodney, here's the patch for r283 to make emblems working again.
However I would not put a synchronized icon by default, this is misleading (but design team probably knows better)

Additionally ubuntuone-nautilus queries syncdaemon for symlinks (such as "Shared with Me") and DBus calls fail, probably worth excluding from get_metadata() as well.

Revision history for this message
Roman Yepishev (rye) wrote :

Fixed the patch to include only the relevant lines.
The emblems are there but they are not updated when files after files are actually uploaded. I think that these messages explain the reason behind such issues:
* (nautilus:15094): WARNING **: No marshaller for signature of signal 'UploadFinished'
** (nautilus:15094): WARNING **: No marshaller for signature of signal 'DownloadFinished'
** (nautilus:15094): WARNING **: No marshaller for signature of signal 'ShareCreateError'

Revision history for this message
Roman Yepishev (rye) wrote :

...And the emblems are back.

The patch may need some cleanup and relocation of the function declarations or rename for marshallers but otherwise it is completely functional.

I haven't tested the case with ShareCreateError so this probably needs to be tracked in a separate bug report.
I'll attach the screenshot of emblems in action.

Revision history for this message
Roman Yepishev (rye) wrote :
Revision history for this message
Roman Yepishev (rye) wrote :

The bug #491777 describes the flickering issue the users will experience if the fix is applied as is.
I suggest fixing that bug first and then returning to this one.

Roman Yepishev (rye)
tags: added: nautilus-emblems
Revision history for this message
Roman Yepishev (rye) wrote :

The share emblems are not showing up, the share-related code does not do path conversion from relative path to absolute. The lookups are performed using absolute path.

Revision history for this message
Roman Yepishev (rye) wrote :

Ok, tested share emblems and they are processed correctly (so my previous comment is all wrong).
The missing part is to signal Nautilus about the emblem change.
See https://bugs.launchpad.net/ubuntu/+source/ubuntuone-client/+bug/491777/comments/2 for the reply from Nautilus developer about this.

Revision history for this message
Roman Yepishev (rye) wrote :

This is the patch that fixes both #479475 and #491777.

However, I would suggest that by default the files should not get "synchronized" emblem. Syncdaemon may be too busy to respond but the files will carry "synchronized" check marks assuring the user that they are already available from the web interface.

  if (!g_hash_table_lookup (uon->updated, path) &&
       !g_hash_table_lookup (uon->needsupdating, path)) {
- /* Add the unsynchronized emblem anyway, and update later */
- nautilus_file_info_add_emblem (file, "ubuntuone-synchronized");
+ /* Add the synchronized emblem anyway, and update later */
+ nautilus_file_info_add_emblem (file, "ubuntuone-unsynchronized");
     dbus_g_proxy_begin_call (uon->u1_fs, "get_metadata",
         ubuntuone_nautilus_update_meta, uon,
         NULL, G_TYPE_STRING, path, G_TYPE_INVALID);
     goto updating_meta;
   }

You can see the emblems in action here: http://www.youtube.com/watch?v=a2gxJQ2jwqM
It also shows that default synchronized emblems are bad, see the photo upload part.

Revision history for this message
Roman Yepishev (rye) wrote :

Emblems are also misleading in the following cases:
 * u1conflict files
 * .u1partial (in case hidden files are displayed)
 * symlinks (Shared With Me) folder.

While the first two should get completely different emblems (new bug report?), the symlink item is more interesting.

Syncdaemon does NOT handle paths '$HOME/Ubuntu One/Shared with Me/$share from $user' resulting in KeyError:
(nautilus:9978): UbuntuOne-Nautilus-WARNING **: ERROR: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/dbus_interface.py", line 626, in get_metadata
    mdobj = self.fs_manager.get_by_path(path.encode('utf-8'))
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/filesystem_manager.py", line 521, in get_by_path
    mdid = self._idx_path[path]
KeyError: '/home/rtg/Ubuntu One/Shared With Me'

(nautilus:9978): UbuntuOne-Nautilus-WARNING **: ERROR: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/dbus_interface.py", line 626, in get_metadata
    mdobj = self.fs_manager.get_by_path(path.encode('utf-8'))
  File "/usr/lib/python2.6/dist-packages/ubuntuone/syncdaemon/filesystem_manager.py", line 521, in get_by_path
    mdid = self._idx_path[path]
KeyError: '/home/rtg/Ubuntu One/Shared With Me/Study from User/cryptography'

Therefore it is not possible to find out whether the file is uploading, downloading or really synchronized if it is in shared folder.
I guess this is a different bug, but it is worth mentioning here, since this falls into a category of "emblems don't display correct sync status".

Revision history for this message
Roman Yepishev (rye) wrote :

After spending some time trying to do clever things for 'Shared With Me' emblems I ended up with the following:

All signals use $HOME/.local/share/ubuntuone/shares directory for shared files, and 'Shared With Me' is a symlink to this directory.
Since Nautilus never visits the original directory it is not possible to get NautilusFileInfo for it.

<alex> rtg: The correct way to implement something like that is to request the NautilusFileInfo object for the uri that change, if it exists, and if so call a "refresh" operation on it
<alex> rtg: such support doesn't exist, but i'd be happy getting patches to add it
https://bugs.launchpad.net/ubuntu/+source/ubuntuone-client/+bug/491777/comments/2

It is possible to create internal mapping for symlink to real file relation, however the reverse mapping is needed as well. It might be possible to create a static mapping for $HOME/.local/share/ubuntuone/shares<->$HOME/Ubuntu One/Shared With Me. I don't like hardcoding paths but, unless the patch for Nautilus is created, we might end up doing this.

P.S. We still need some emblem for u1conflict files.

Revision history for this message
Roman Yepishev (rye) wrote :

Split the bug into three reports:

#498131 Default emblem for "unknown" file status should be "unsynchronized"
#498134 u1conflict files should have different emblem
#498136 All "Shared With Me" folder items have emblems broken

Changed in ubuntuone-client (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Redmar (redmar) wrote :

Hi all, I reported a duplicate of this bug.

I've been unable to remove the "Synchronized" icon even after pasting the file to the desktop. Could this be related to whats going on here?

Revision history for this message
sirald66 (sirald66) wrote :

While Ubuntu works on these problems, DropBox (which I think this is based on) is stable.

Revision history for this message
Andre (ajx) wrote :

Emblem on folder does not show the right sync status. File is synced to the cloud, the folder, too. But only the file within the folder shows the right status.

dobey (dobey)
Changed in ubuntuone-client:
assignee: Rodney Dawes (dobey) → Roman Yepishev (rye)
status: Triaged → Fix Released
Changed in ubuntuone-client (Ubuntu):
assignee: Rodney Dawes (dobey) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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