Closed Bug 360111 Opened 17 years ago Closed 16 years ago

dying js context

Categories

(Calendar :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: michael.buettner, Assigned: michael.buettner)

References

Details

Attachments

(1 file)

assume a dialog calls some asynchronous method on a provider with an interface that should be called back in order to receive the result. in case the js context of the dialog vanishes before the provider actually calls back through the interface an exception will be thrown (JavaScript Error: "Components is not defined").

The scenario described above happens immediately in case you access the 'invite attendees'-dialog of the prototypes event dialog and cancel the dialog before all free/busy requests have been answered by the WCAP provider.
daniel: wouldn't it be a good idea to have some interface (e.g. calICancelable) that gets returned upon calling something like getFreeBusyTimes()? I think this would be a clean solution to the problem. otherwise I need to wrap the call outside of the dialog, which seems to be more of a hack than anything else.
(In reply to comment #1)
> daniel: wouldn't it be a good idea to have some interface (e.g. calICancelable)
> that gets returned upon calling something like getFreeBusyTimes()? I think this
> would be a clean solution to the problem. otherwise I need to wrap the call
> outside of the dialog, which seems to be more of a hack than anything else.

Yes, I have had similar thoughts last week for all async calls currently in play. I will post a proposal to the ng.
Depends on: 329034
Attached patch patch v1Splinter Review
Since the WCAP provider now supports cancelable requests, this patch contains the necessary modifications in order to make use of the latest WCAP api.
Checked in on trunk and MOZILLA_1_8_BRANCH
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.