【问题标题】:gloda query result infinite loop?gloda查询结果无限循环?
【发布时间】:2017-03-02 13:48:22
【问题描述】:

我正在就已加星标的消息查询 Thunderbird/Gloda(其他查询也会发生)。另外,我假设所有返回的消息都应该有一个 id(不返回:未定义的 id)。

  let query = Gloda.newQuery(Gloda.NOUN_MESSAGE);query.bodyMatches("dd");

或 ....

let query = Gloda.newQuery(Gloda.NOUN_MESSAGE);query.starred(true);

我有一条已加星标的消息。如果我遍历返回的集合,我会得到 1 个 id(通过 alert(msg.id);)和数百万个“未定义”。实际上,我必须先杀死 Thunderbird,然后才能摆脱明显的无限循环。

观察: aCollection.items.length=0(但有1个id)

迭代的方式,都导致无休止的循环:

1)
for each (let glodaMsg in aCollection)

2)

for each (let [, glodaMsg] in Iterator(aCollection))

3) 这是来自 MDN:https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Gloda_examples

try {
        for (var glodaMsg in aCollection) {
            //do something with the Conversation here
            alert(glodaMsg.id);
        }
    } catch (e) {};

只是一个补充说明: 如果我尝试在tabmail中显示集合,它是空的,对应于length==0:

用于展示:

        let tabmail = document.getElementById("tabmail");
          tabmail.openTab("glodaList", {
            collection: aCollection,
            title: "glodasearch",
            background: false
          });

发生了什么,我做错了什么?

感谢任何帮助,

克劳斯

【问题讨论】:

    标签: thunderbird thunderbird-addon


    【解决方案1】:

    我尝试使用引号中的 true 并在我的控制台上对其进行了测试。 query.starred("true"); 应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-20
      • 2011-07-25
      相关资源
      最近更新 更多