Zim

Re-build index ignores subpages when subpage not created in zim

Bug #704167 reported by smu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zim
Fix Released
High
Unassigned

Bug Description

The subject of this bug report may be a bit confusing, so here is the full description:

I am using zim on multiple computers and sznc my notebook via git (previously dropbox). When I create a new page on computer A and sync the notebook with computer B, I have to re-build the index in B, to see the new page in the index.
But this rebuild fails to discover the new page, when it is a subpage and the directory containing this new subpage did not exists in the version that was used on computer A before the sync.

Steps to reproduce:
1. Create a new page Test.txt
2. simulate the sync process by
2.a. mkdir Test
2.b cp Test.txt Test/subpage.txt
3 Re-build the index.

Result: subpage.txt is not found by the update function.

Tags: import
Changed in zim:
status: New → Confirmed
importance: Undecided → High
tags: added: import
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Can you check if this is still present? I remember seeing some behavior similar as described earlier, but can't just tested it again and can not reproduce.

Changed in zim:
status: Confirmed → Incomplete
Revision history for this message
smu (smu) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Fri, Apr 08, 2011 at 06:31:31PM -0000, Jaap Karssenberg wrote:
> Can you check if this is still present? I remember seeing some behavior
> similar as described earlier, but can't just tested it again and can not
> reproduce.

I can not test it with revision 378 (Bug #757651) but with rev. 377 it
still does not work.
But if works if I rebuild the index with the --index switch.

You can not reproduce it using the description I mentioned in the first
report?

best regards,
 stefan

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Mon, Apr 11, 2011 at 5:46 PM, smu <email address hidden> wrote:

> On Fri, Apr 08, 2011 at 06:31:31PM -0000, Jaap Karssenberg wrote:
> > Can you check if this is still present? I remember seeing some behavior
> > similar as described earlier, but can't just tested it again and can not
> > reproduce.
>
> I can not test it with revision 378 (Bug #757651) but with rev. 377 it
> still does not work.
> But if works if I rebuild the index with the --index switch.
>
> You can not reproduce it using the description I mentioned in the first
> report?
>

That's what I did, but worked fine. Not sure what else can be different...

-- Jaap

Revision history for this message
smu (smu) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Thu, Apr 14, 2011 at 07:39:54PM -0000, Jaap Karssenberg wrote:
> >
> > You can not reproduce it using the description I mentioned in the first
> > report?
> >
>
> That's what I did, but worked fine. Not sure what else can be
> different...
>

that is strange! I tried it on different Linux systems with different
notebooks, filenames, setings, ... everytime the same result.

But if you can't reproduce it and no one else has this problem just
ignore it.

best regards,
 stefan

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Fri, Apr 15, 2011 at 10:48 AM, smu <email address hidden> wrote:

> that is strange! I tried it on different Linux systems with different
> notebooks, filenames, setings, ... everytime the same result.
>
> But if you can't reproduce it and no one else has this problem just
> ignore it.
>

I tried a couple of more times, but still not able to reproduce.

Maybe you could try to write a test script which fails on this ? That might
help figurign out what I do wrong and it could go in the test suite
afterward.

-- Jaap

Revision history for this message
smu (smu) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Wed, Apr 27, 2011 at 07:17:53PM -0000, Jaap Karssenberg wrote:
> On Fri, Apr 15, 2011 at 10:48 AM, smu <email address hidden> wrote:
>
> > that is strange! I tried it on different Linux systems with different
> > notebooks, filenames, setings, ... everytime the same result.
> >
> > But if you can't reproduce it and no one else has this problem just
> > ignore it.
> >
>
> I tried a couple of more times, but still not able to reproduce.
>
> Maybe you could try to write a test script which fails on this ? That might
> help figurign out what I do wrong and it could go in the test suite
> afterward.

good idea, I will do that.

best regards,
 stefan

Revision history for this message
smu (smu) wrote :

finally I managed to write small (maybe quick and dirty) test-case.
I am not sure were to place it, in the patch attached I added a function to tests/notebook.py (TestGetNotebook).

I hope it helps to understand and reproduce the behavior described above.

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Sun, May 15, 2011 at 5:55 PM, smu <email address hidden> wrote:

> finally I managed to write small (maybe quick and dirty) test-case.
> I am not sure were to place it, in the patch attached I added a function to
> tests/notebook.py (TestGetNotebook).
>
> I hope it helps to understand and reproduce the behavior described
> above.
>

Afraid not, merged the path in the TestNotebook class without further edits
and this is the result:

"""
jaap@mirage:~/code/pyzim-trunk$ ./test.py
notebook.TestNotebook.testSynchronization
testSynchronization (tests.notebook.TestNotebook)
Test synchronization ... ok

----------------------------------------------------------------------
Ran 1 test in 1.855s

OK
"""

So no error as I expected. Will keep the test, will merge it into
tests/index.py.

Regards,

Jaap

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

More interestingly, now I simplified the test and merged it it starts
failing...

So there is something there, let's see if I can pin point it

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

And I found the error - beats me why my earlier tests did not show it, put the indexing on the list as a candidate for a code cleanup

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

P.S. will commit in rev403

Changed in zim:
status: Incomplete → Fix Committed
Revision history for this message
smu (smu) wrote : Re: [Bug 704167] Re: Re-build index ignores subpages when subpage not created in zim

On Sun, May 15, 2011 at 07:00:00PM -0000, Jaap Karssenberg wrote:
> And I found the error - beats me why my earlier tests did not show it,
> put the indexing on the list as a candidate for a code cleanup

cool, nice to hear, that it was finally possible to reproduce this bug.

thank you and best regards,
 stefan

Revision history for this message
Jaap Karssenberg (jaap.karssenberg) wrote :

Fix released in zim 0.53.

Changed in zim:
status: Fix Committed → 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.