duplicates in task completion popup after reloading the log

Bug #238505 reported by Gaute
2
Affects Status Importance Assigned to Milestone
GTimeLog
Fix Released
Low
Marius Gedminas

Bug Description

Steps to reproduce

1. Make sure ~/.gtimelog/gtimelogrc *doesn't* have 'gtk-completion = False'
2. Start gtimelog. Type something that you already had in the history. Watch the completion popup.
3. Hit Ctrl+R to reload.
4. Erase last character and type it again, to trigger the completion popup.

Expected result: you see the same choices in the completion popup.

Actual result: you see twice as many choices in the popup, each one repeated.

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I was unable to reproduce this. Could you provide more information:

  * are you using a local or a remote task list?
  * are you reloading the task list (right-click on the task pane), or the time log (file -> reload)?
  * are all tasks duplicated, or just some of them?
  * does this happen with the latest version (subversion trunk)?

To test the latest version all you need to do is check it out -- no need to install, you can run it directly from the checkout:

  svn co http://mg.pov.lt/gtimelog/svn gtimelog
  cd gtimelog
  ./gtimelog

Changed in gtimelog:
status: New → Incomplete
Revision history for this message
Gaute (gaute-div) wrote :

On Tuesday 10 June 2008 01:52:36 Marius Gedminas wrote:
> I was unable to reproduce this. Could you provide more information:
>
> * are you using a local or a remote task list?

 ~/.gtimelog/tasks.txt which is on a regular partition.
-rw-r--r-- 1 gaute gaute 64 2008-05-05 15:13 /home/gaute/.gtimelog/tasks.txt

> * are you reloading the task list (right-click on the task pane), or the
> time log (file -> reload)?

File->reload, or Ctrl+R.
Right-click->refresh has no problem.

> * are all tasks duplicated, or just some of them?

Everything it seems. both from task list and timelog.
One extra copy added per reload with no apparent limit.

> * does this happen with the latest version (subversion trunk)?

All this tested with svn version yes.

> To test the latest version all you need to do is check it out -- no need
> to install, you can run it directly from the checkout:
>
> svn co http://mg.pov.lt/gtimelog/svn gtimelog
> cd gtimelog
> ./gtimelog
>
>
> ** Changed in: gtimelog
> Status: New => Incomplete

More info:

$ cat /home/gaute/.gtimelog/gtimelogrc
[gtimelog]
list-email = Gtimelog-Rapport<email address hidden>
#mailer = x-terminal-emulator -e mutt -H %s
mailer = wmctrl -a emacs21@ && emacsclient -n %s
name = Gaute
edit_task_list_cmd =
virtual_midnight = 04:00
hours = 8
#editor = gvim
editor = wmctrl -a emacs21@ && emacsclient
task_list_url =
gtk-completion = True

$ cat /home/gaute/.gtimelog/tasks.txt
god morgen
besvare mail

private gjøremål **
lunsj **
loke **

$ ll ~/.gtimelog/
total 32
-rw-r--r-- 1 gaute gaute 316 2008-05-09 13:33 gtimelogrc
-rw-r--r-- 1 gaute gaute 294 2008-05-08 12:55 gtimelogrc~
-rw-r--r-- 1 gaute gaute 64 2008-05-05 15:13 tasks.txt
-rw-r--r-- 1 gaute gaute 64 2008-04-28 08:47 tasks.txt~
-rw-r--r-- 1 gaute gaute 7628 2008-06-10 06:59 timelog.txt
-rw-r--r-- 1 gaute gaute 7511 2008-06-09 14:25 timelog.txt~

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I still cannot reproduce :/

What do you mean by "both from task list and timelog"? (A screenshot might help.)

Are there any error messages on the terminal where you started gtimelog?

Revision history for this message
Marius Gedminas (mgedmin) wrote : Re: [Bug 238505] Re: duplicates in task menu after reload

On Tue, Jun 10, 2008 at 05:52:31PM +0200, Gaute Amundsen wrote:
> On Tuesday 10 June 2008 15:47:39 Marius Gedminas wrote:
> > I still cannot reproduce :/
> >
> > What do you mean by "both from task list and timelog"? (A screenshot
> > might help.)
>
> The autocomplete menu gets it's alternatives both from task list and timelog,
> right?
> In my example i have "lunsj **" in my tasks.txt
> once i wrote "lunsj and more **", and that is now in my timelog.txt
> When i start writing "lun" they both show up. If I reload they both show up
> one time extra for every reload.

Ah, so you're speaking about duplicates in the completion popup, and not
about duplicates in the task list! I can reproduce this now.

> But.. I could no longer resist : )
>
> How about this?
>
> About line 1055:
>
> seen = map(lambda x: list(x)[0], self.completion_choices)
> for entry in self.history:
> if entry not in seen:
> seen.append(entry)
> self.completion_choices.append([entry])
>
> This fixes the problem for me.

The output of 'svn diff' would have been a bit clearer, but I see what
you did there.

> There is probably a better way to get at completion_choices...

I would prefer to clear self.completion_choices instead, because if
you've fixed a typo in an earlier entry in the history, I'd rather see
just the fixed one among completions, instead of both.

And now that I understand what the bug actually is, I can fix it.

Marius Gedminas
--
Unix is the answer, but only if you phrase the question very carefully.
                -- Belinda Asbell

Changed in gtimelog:
assignee: nobody → mgedmin
importance: Undecided → Low
status: Incomplete → In Progress
description: updated
Revision history for this message
Marius Gedminas (mgedmin) wrote :

Fixed in version 0.2.3.

Changed in gtimelog:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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