[#1257] Incomplete Thread View
Summary Incomplete Thread View
Queue IMP
Queue Version 4.0.1
Type Bug
State Resolved
Priority 1. Low
Owners slusarz@horde.org
Requester kteam.eu@gmail.com
Created 2005-01-27 (5883 days ago)
Updated 2005-02-16 (5863 days ago)
Assigned 2005-02-11 (5868 days ago)
Resolved 2005-02-16 (5863 days ago)
Patch No

kteam.eu@gmail.com 2005-01-27 07:59:04
When you delete a message the resulting array containing thread

structure is missing the matching index, and this is correct. but when

you try to get the thread list iterating $key it breaks and you get an

incomplete list. The right behaviour should be to continue with next step.

Chuck Hagenbuch <chuck@horde.org> 2005-01-27 15:15:40
Please attach the patch you mentioned to this ticket.

kteam.eu@gmail.com 2005-02-10 11:07:48
ok, this is the patch for this problem that fixes also another issue, 
(you get a broken thread if the thread contains the first message of 
the mailbox)

Michael Slusarz <slusarz@horde.org> 2005-02-11 03:52:08
This patch makes no sense.  First, why are you changing the return 
value of getKey from false to null?  That doesn't get you anywhere.   
Second, why are you using ++$key instead of $key++?  You are missing a 
whole potential case by doing this.  Third, if ($this->_thread[$key]) 
doesn't exist, you have a mailbox that is corrupt - that code should 
never be reached or else there are issues elsewhere.  So it makes a 
whole bunch of sense to exit the loop rather than ignore the entry - 
which may lead to some very weird output.

Michael Slusarz <slusarz@horde.org> 2005-02-11 03:54:06
Also wanted to mention that I have not been able to reproduce a 
situation that leads to incomplete thread view (viewing/deleting a 
thread item that is the first item in the mailbox, for example, 
doesn't cause any error for me).  There is no detailed description in 
this bug report on how to reliably reproduce unwanted behavior.

Michael Slusarz <slusarz@horde.org> 2005-02-16 07:50:08
Response from K-team:

Sorry, I thought it was clear....you just have to send a mail from an

empty mailbox and reply a couple of times, so that you have a thread.

if you sort the mailbox by thread it seems good, but when you read a

message from the thread, if you click on "View Thread" it shows just

the message you were reading. After investigating a while I noticed

that _getKey sometimes returns key=0 for the first mail in thread. in

getThreadBase this test:

  if ($key = $this->_getKey($index))

fails if $key is 0, so I modifyed it in

  $key = $this->_getKey($index); + if (isset($key))

and set return value to null in _getKey when it fails.

I also changed $key++ to ++$key for the same reason, the while loop

breaks soon if $key is 0.

As far as regards the third point, I've run into a situation in which

a deleted message breaks the thread and it displays nothing, so

thought it was better to end the cycle and just skip the message.

Hope it's clearer now


Michael Slusarz <slusarz@horde.org> 2005-02-16 07:55:24
OK - I wasn't understanding that you were seeing this on the thread 
screen - I thought this was something you were seeing on the mailbox 

I've modified your patch to check for the "nullness" of the return 
value, as well as fixing several other functions and the use of $key.   
For now, I am not going to address your 3rd point since I have not yet 
seen this behavior.

Michael Slusarz <slusarz@horde.org> 2005-02-16 07:56:00
The fix has been applied to HEAD and Horde 3.0.4, BTW.