After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 624296 - undo for "remove from favorites" doesn't work
undo for "remove from favorites" doesn't work
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-07-14 01:32 UTC by Maxim Ermilov
Modified: 2010-07-20 12:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix "undo remove from favorites" (1.32 KB, patch)
2010-07-14 01:36 UTC, Maxim Ermilov
committed Details | Review

Description Maxim Ermilov 2010-07-14 01:32:08 UTC
JS ERROR: !!!     message = 'this._favorites[appId] is undefined'
    JS ERROR: !!!     lineNumber = '106'
    JS ERROR: !!!     fileName = '/home/zaspire/gnome-shell/source/gnome-shell/js/ui/appFavorites.js'
    JS ERROR: !!!     stack = '("transmission.desktop")@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/appFavorites.js:106
([object Object],[object Object])@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/appDisplay.js:829
([object Object],[object Object])@/home/zaspire/gnome-shell/install/share/gjs-1.0/lang.js:110
_emit("activate",[object Object])@/home/zaspire/gnome-shell/install/share/gjs-1.0/signals.js:124
([object Object],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/popupMenu.js:243
([object Object],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/install/share/gjs-1.0/lang.js:110
_emit("activate",[object _private_Clutter_Event])@/home/zaspire/gnome-shell/install/share/gjs-1.0/signals.js:124
([object _private_St_Bin],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/source/gnome-shell/js/ui/popupMenu.js:35
([object _private_St_Bin],[object _private_Clutter_Event])@/home/zaspire/gnome-shell/install/share/gjs-1.0/lang.js:110
Comment 1 Maxim Ermilov 2010-07-14 01:36:31 UTC
Created attachment 165839 [details] [review]
fix "undo remove from favorites" 

Problem appear after port to GSettings.
In GSettings, a change notification is generated immediately from context of the _set() call.
In GConf, The "value_changed" signal is emitted whenever the server notifies your client program that a value has changed in the database (100% NOT from context of the _set() call).
Comment 2 drago01 2010-07-19 19:24:16 UTC
(In reply to comment #1)
> Created an attachment (id=165839) [details] [review]
> fix "undo remove from favorites" 
> 
> Problem appear after port to GSettings.
> In GSettings, a change notification is generated immediately from context of
> the _set() call.
> In GConf, The "value_changed" signal is emitted whenever the server notifies
> your client program that a value has changed in the database (100% NOT from
> context of the _set() call).

I am not sure I understand this but you are saying that the notification gets delivered when set is called and not after the value has actually been updated in the database?
This sounds weird or even broken.
Comment 3 Maxim Ermilov 2010-07-19 19:48:50 UTC
(In reply to comment #2)
> (In reply to comment #1)
> I am not sure I understand this but you are saying that the notification gets
> delivered when set is called and not after the value has actually been updated
> in the database?
> This sounds weird or even broken.

http://blogs.gnome.org/desrt/2009/06/09/some-nice-gsettings-facts/
Comment 4 drago01 2010-07-19 19:56:50 UTC
Review of attachment 165839 [details] [review]:

Should be fine then; and seems to work fine here.
Comment 5 jefry.reyes 2010-07-20 03:12:52 UTC
Review of attachment 165839 [details] [review]:

I think this is not fixing the problem.


The program was failing because of this error:

'this._favorites[appId] is undefined'

which was on this line:

 Main.overview.infoBar.setMessage(_("%s has been removed from your favorites.").format(this._favorites[appId].get_name()),
                                         Lang.bind(this, function () {
            this._addFavorite(appId);
        }));

this._favorites[appId] is undefined because appId is not in this._favorites

There is code in this._removeFavorite that will check if appId is in this._favorites and in case it isn't it won't execute the line of code that just failed.
In the patch you are assigning the value of this._favorites[appId] before the check is done. The reason why is failing, is because the conditional is wrong, the code that is supposed to check if appId is in this._favorites is not working.