Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Thunderbird extension unexpectedly stops execution

Something strange is happening in an extension I'm building in Thunderbird. I've pinpointed it to a very specific example. This example works fine in a regular node.js environment, but in Thunderbird it simply stops execution at a random point in time (looks like it's time dependent).

I'm using an await command inside a for loop, but the for loop never reaches the end. If I remove the await command, it works fine.

I'm thinking there might be some sort of a limitation of time with the MailExtensions API? Not sure what to do here.

This is the code:

  async function load() {
    let tmp;
    for (var i = 0; i < 30; i++) {
      console.log(`i: ${i}, before the await`);
      tmp = await resolveAfterTimeout();
      console.log(`i: ${i}, after the await`);
    };
    console.log('done');
  }

  function resolveAfterTimeout() {
    console.log('inside timeout');
    return new Promise(resolve => {
      console.log('inside new Promise');
      setTimeout(() => {
        console.log('inside setTimeout');
        resolve('resolved');
      }, 100);
    });
  }

Console Output (end):

i: 5, after the await
i: 6, before the await
inside timeout
inside new Promise
inside setTimeout
i: 6, after the await
i: 7, before the await
inside timeout
inside new Promise
inside setTimeout
i: 7, after the await
i: 8, before the await
inside timeout
inside new Promise
Webconsole context has changed
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Problem solved with the help of the amazing thunderbird forum chat members! Looks like it's completely my fault - the extension is activated by a popup and runs while the popup is open. I would click on a button to open the popup and switch to the console to see the output, while actually closing the popup and being surprised why the execution stops:)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda