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 608842 - when adding a new ticker, user has to specify label
when adding a new ticker, user has to specify label
Status: RESOLVED OBSOLETE
Product: gnome-applets
Classification: Other
Component: invest-applet
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Enrico Minack
gnome-applets Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-02-02 22:34 UTC by Matteo Zandi
Modified: 2018-03-12 12:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
retrieve label automatically (2.32 KB, patch)
2010-02-02 22:34 UTC, Matteo Zandi
needs-work Details | Review
retrieve ticker label automatically, cancel if user edits field in the meantime (4.42 KB, patch)
2010-02-13 11:16 UTC, Matteo Zandi
none Details | Review
updated version of the automatic stock name retriever (5.80 KB, patch)
2010-07-08 14:45 UTC, Enrico Minack
needs-work Details | Review

Description Matteo Zandi 2010-02-02 22:34:37 UTC
Created attachment 152887 [details] [review]
retrieve label automatically

when pressing the add button in the preferences dialog, a new row is created with ticker 'GOOG' and label 'Google Inc.', the user should change both the ticker and label accordingly.

With this patch the label is automatically retrieved from yahoo, after the user enters the ticker
Comment 1 Enrico Minack 2010-02-10 15:08:16 UTC
Review of attachment 152887 [details] [review]:

Nice patch. It does the job. However, the code has to make sure that on a slow internet connection, the retrieved label does not overwrite a user's label just entered after setting the symbol. Maybe, once the label field of a stock gets modified, the name resolver should be stopped, or its result should be discarded if the user currently enters / already entered a label.
Comment 2 Matteo Zandi 2010-02-13 11:16:47 UTC
Created attachment 153702 [details] [review]
retrieve ticker label automatically, cancel if user edits field in the meantime

now the retrieve process is cancelled if the user edits the label field before it is updated
Comment 3 Matteo Zandi 2010-02-13 12:01:13 UTC
it would be nice to add a spinning icon or something like that so that the user notices that the label is updating automatically
Comment 4 Enrico Minack 2010-07-08 14:45:50 UTC
Created attachment 165481 [details] [review]
updated version of the automatic stock name retriever

Thanks for the patch. I updated it so it works with git head. Though it handles the "user changed the label in the meantime", it still leaves some serious states unhandled:
- when label of existing stock is modified, this gives exception, since NameResolver is None then
- name retriever are never removed from the store
- when a new name retriever is created, a possibly existing one has to be cancelled and dropped first
- only retrieve the name when the symbol is really changed, otherwise existing (possibly user-entered) label will be overwritten

These are all fixed in the new patch.

still open issues
- removing a stock that has a running name retriever causes a segfault or at least exception when name is retrieved and the store is to be updated (the respective row is not existing anymore)

This could be fixed in two ways:
- make sure the store_path is still valid when updating the label
- cancel the name retriever before removing a stock

I am not too familiar with the path and iterator of the liststore wrapping treeview. I also do not know how to check if the store_path of the liststore is still valid. I guess it is easier for you to fix the problem at any of the two locations.
Comment 5 Enrico Minack 2010-07-08 15:51:00 UTC
A further bug that I just recognized, due to a feature of Yahoo, that can be exploited via the name retriever is the following:
- add YHOO.DE stock
- the applet will retrieve data for YHO.DE, which it then does not know where in the store to put them
- this will cause an exception and no stock information can be retrieved and displayed

The solution would be to check when the name retriever recieves the data if the symbol changed, and correct the respective value in the store. This should be done even if the retriever was cancelled, because a wrong symbol will break everything and the cancellation does only hold for the label. It will be problematic if someone changes the symbol and then changes it again while the first retriever did not finish.

Since the retriever knows the original symbol, it can check if there is still that symbol in the store.
Comment 6 Enrico Minack 2011-06-29 19:55:03 UTC
the latter bug is fixed in http://git.gnome.org/browse/gnome-applets/commit/?id=9be66818e7b75df4db86b88154c7df47afda9a79
Comment 7 Alberts Muktupāvels 2018-03-12 12:45:47 UTC
Invest applet has been removed because Yahoo Finance API is no longer available.