Is this a bug? .destroy() never resolves if called inside left-meeting event handler

Options
jayne
jayne Member, Daily Alumni admin
edited September 2022 in Q&A

(originally posted by frankie567 on Github)

Expected behavior

Inside a left-meeting event handler, I want to be able to call .destroy() so that the resources and the iframe are destroyed after the participant has left.

Describe the bug (unexpected behavior)

When calling .destroy(), the promise is never resolved, and the resources and iframe are not destroyed.

Steps to reproduce

CodeSandbox reproducing the issue

const callIFrame = DailyIframe.createFrame({
    iframeStyle: {
        position: "fixed",
        top: "0px",
        left: "0px",
        width: "100%",
        height: "100%"
    },
    showLeaveButton: true,
    activeSpeakerMode: false
});
callIFrame.join({
    url: "XXX"
});

callIFrame.on("left-meeting", () => {
    console.log("Call destroy...");
    callIFrame.destroy().then(() => {
        console.log("Destroyed!"); // Never reached
    });
});

Screenshots

N/A

System information

  • Device: MacBook Pro M1
  • OS, version: macOS 12.4
  • Browser, version: Google Chrome 101
  • @daily-co/daily-js: 0.26.0

Additional context

  • It was working well in version @daily-co/daily-js 0.22.0.
  • I suspect it was introduced by this change: dff9d8259d819e90c49be398b6edd02f2fa0ddef
Tagged:

Comments

  • Tasha
    Tasha Community Manager, Dailynista admin
    edited August 2022
    Options

    Thanks for sharing this @jayne !

    I have notified our engineering team and they will take a look. I will post another update here, once that is done.

  • Tasha
    Tasha Community Manager, Dailynista admin
    Options

    Here's some new info on this issue:

    • Our engineers have confirmed that it is a bug and have added it to their queue to address.
    • Once it is fixed, I will post another update here.

    If you have any questions about this in the meantime, let me know!