Merge lp:~bertrand-rousseau/gtg/bugfix-984880-tag-relation-not-stored into lp:~gtg/gtg/old-trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Izidor Matušov | ||||
Proposed branch: | lp:~bertrand-rousseau/gtg/bugfix-984880-tag-relation-not-stored | ||||
Merge into: | lp:~gtg/gtg/old-trunk | ||||
Diff against target: |
62 lines (+25/-2) 2 files modified
GTG/core/datastore.py (+25/-0) GTG/core/tag.py (+0/-2) |
||||
To merge this branch: | bzr merge lp:~bertrand-rousseau/gtg/bugfix-984880-tag-relation-not-stored | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gtg developers | Pending | ||
Review via email: mp+120290@code.launchpad.net |
Description of the change
Here's a patch that introduces tag tree modifications monitoring from the datastore. This allows to request a save of the tag tree each time a tag is modified. However, in order to reduce the number of save requests, a timeout is added to only request a save 1 second after a node-modified signal is received. That behavior allows to filter unnecessary saves when a burst of "node-modified" signals are sent.
The good part:
- it fixes bug #984880 (tag relations not saved on kill)
- tag tree will now be regularly be saved when tags are modified (in the generic sense), which is the feature we want.
The bad part:
- tag's "node-modified" signals are often sent unnecessarily (this is not related to this patch, it's a consequence of GTG current implementation). For instance, when a task is modified, it always notifies _all_ its tags as modified although most of the times, they are not (it serves as a hack to request a refresh of the tag list counters I suppose). With this patch, this behavior will cause a tag save request to be sent unnecessarily at each task modification. Not cool: performing unnecessary work always increase the risk of errors. We should figure out a way to reduce/remove those requests or to filter them out of the monitoring. No idea so far on how to do this, but I haven't though much about it too.
- this patch changes the way tags are saved when tag attributes are edited. Before, a save was explicitly requested. Now, it catches the "node-modified" signal, so it happens a bit more indirectly. It may cause side-effects, which will require some testing to figure out.
- obviously, if GTG is killed before 1 second after a tag is modified, the tag tree won't be updated on the disk. But now, if it does, it's more probably due to a code-related crash rather than a user-related action (indeed, killing GTG explicitly in less than 1 second after having modified a tag is really hard for a user), so we can't guarantee a safe tag tree save anyway.
Release-wise, I think this patch needs to be discussed further, and is too "experimental" to land in 0.3. But I'm interested in discussing options here so I start a merge request anyway.
Unmerged revisions
- 1229. By Bertrand Rousseau
-
lint and pep8
- 1228. By Bertrand Rousseau
-
Register a callback on 'node-modified' signal for tag: allows to watch for tag modifications and request a tag tree save. Also, remove the explicit save request on tag attribute change since those can be catched by monitoring tag modifications anyway.
After discussion at the mailing list, closing this merge request as "rejected". We should fix this properly soon.