Re: Fix to ensure whiteboards update



On Thu, 2005-04-21 at 21:06 -0400, David Malcolm wrote:
> I ran into a bug in which whiteboards don't update until after something
> else updates within that topic.
> 
> Whiteboards are inside Discussions, in turn inside ActiveTopics.
> 
> When a whiteboard is first created, the owning Discussion changes
> serverside, it updates, dumpObjects is called on it, it gets synced to
> the client.  
> 
> So now, if getInterestingObjects were to be called on the Discussion or
> the ActiveTopic, it would contain the new Whiteboard.  However, it
> doesn't get called until something causes the Topic to update.  Hence
> newly created Whiteboards don't update as you draw on them until
> something else within the topic updates.  Only then will they start
> receiving updates (and can also be used to trigger updates for further
> newly-created whiteboards exhibiting this bug).
> 
> So it appears that changes to a deep descendent of a
> ToplevelReferencableObject don't cause updates, only changes to
> immediate children.
> 
> Attached is a patch that seems to fix this.  The poll/event loop feels
> like deep voodoo to me (hence my diagram), so I didn't want to commit
> this without Alex's witchdoctor-like approval :-)

No, that patch is not right. It will cause all changes to signal changes
in the ActiveTopic, causing us to unnecessarily dumpObject() it for each
change to inner objects. 

However, I'm not sure why this is happening for you. The way its meant
to work is something like (with ordering like in your log):

1) pollForChange() -> discussion changed
2) dump the discussion -> notice the new whiteboard object
3) call getPollUrl() (without the new whiteboard object)
4) we do stuff with the new whiteboard object in javascript
5) After that we call registerObject() on the new whiteboard js object
   However, topic.js has set a registration hook:
    // We need to update the poll list after any new object has been created
    objectRegistry.addHook(function (obj) { theYarrr.updatePoll() })
6) updatePoll() cancels the outstanding poll, regets the set of
interesting objects, and then restarts the poll.

For some reason, step 6 doesn't seem to happen for you. We need to
figure out why.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a time-tossed moralistic filmmaker living undercover at Ringling Bros. 
Circus. She's a cold-hearted blonde hooker in the wrong place at the wrong 
time. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]