Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Check whether originating component is 'finalized' or not #23

Open
ika18 opened this issue Aug 20, 2013 · 3 comments
Open

Check whether originating component is 'finalized' or not #23

ika18 opened this issue Aug 20, 2013 · 3 comments
Labels
Milestone

Comments

@ika18
Copy link
Member

ika18 commented Aug 20, 2013

Ajax callback may happen after a widget dispose. If the callback has some dom action will occur some exceptions.
What if add a function to check whether originating component isfinalized? If the component's phase is finalized, then can just return from ajax callback rather than continue.

@mikaelkaron
Copy link
Member

When you say originating component, what do you mean?

If you are using dom events, the .data part of the event is the instance that triggered the event. For the pubsub there is no such mechanism.

@ika18
Copy link
Member Author

ika18 commented Oct 15, 2013

This idea we talked before. Sometimes an AJAX request ('ajax' hub in troopjs) invokes from a widget. And most time the success callback is to do some dom actions. Consider that the ajax response is denied a couple of seconds and the widget has been disposed, and the callback is still going. Then it will cause an error on dom action.

@mikaelkaron
Copy link
Member

Ah, so this is slightly different then, this ticket basically should be that we should check if the current component is in an allowed phase before triggering a callback (dom or hub).

In troopjs 2.x this already done for hub here and here. I don't remember if this was implemented in 1.x.

I don't think that the same would be that hard to implement in 1.x, but before I look at that I just want to confirm that's what we want to do this (as I remember we discussed support for killing an ajax request at some other point).

@mikaelkaron mikaelkaron added this to the 1.x milestone Feb 14, 2014
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants