首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >事务中超过AngularFire7最大调用堆栈

事务中超过AngularFire7最大调用堆栈
EN

Stack Overflow用户
提问于 2022-07-02 18:15:28
回答 1查看 63关注 0票数 0

我已经写了一篇文章,但this one被关闭了。我还发现了 this post ,这与我得到的错误基本相同。

现在,由于另一个原因,我得到了同样的错误,仍然无法在网上找到任何答案。我使用的是实时数据库,数据库中有一个节点,如下所示:

代码语言:javascript
复制
private: {
  $user_uid: {
    formula: {
      formula_quota:30,
      quota_used:0
    }
  }
}

我使用一个按钮发布一些数据,并运行一个事务来获取配额对象,并在发布完成后对其进行更新。

我不会发布未使用或注释掉的代码,但配额事务如下所示:

代码语言:javascript
复制
quotaTransaction ( userUID:string, projectUID:string, state:EditorState, asObject:boolean, asProject:boolean ) {

    const quotaPath = `/private/${ userUID }/formula`;

    const quotaDoc = ref( this.db, quotaPath );
 
    runTransaction( quotaDoc, quota => {

      let nbPublish = 0;

      if ( asObject ) nbPublish++;
      if ( asProject ) nbPublish++;

      let quotaUsed = quota.quota_used;
      let formulaQuota = quota.formula_quota;

      if ( nbPublish + quotaUsed > formulaQuota ) return ( undefined );

      return ( { quota_used: quotaUsed + nbPublish, formula_quota:formulaQuota } );

    } ).catch( console.log );

}

当我第一次运行quotaTransaction时,我会得到这个错误

RangeError:超过ChildrenNode.isLeafNode (vendor.js:52413:13) at ChildrenNode.equals (vendor.js:20990:22) at ChildrenNode.equals (vendor.js:20995:31) at ChildrenNode.equals (供应商)的最大调用堆栈大小( .js:20995:31) at ChildrenNode.equals (vendor.js:20995:31)

我第二次运行它时,我得到:

ImmutableTree.findRootMostMatchingPathAndValue (vendor.js:23435:30) at ImmutableTree.findRootMostMatchingPathAndValue (vendor.js:23432:51) at ImmutableTree.findRootMostMatchingPathAndValue (vendor.js:23432:51) at ImmutableTree.findRootMostValueAndPath (vendor.js:23456:17) at compoundWriteGetCompleteNode (vendor.js:55532:45) at compoundWriteChildCompoundWrite (vendor.js:55532:45) at compoundWriteChildCompoundWrite (vendor.js:55574:27) at compoundWriteChildCompoundWrite(vendor.js:55574:27) at () at ()

有什么线索吗,也许消防队能帮我?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-07-03 11:29:11

降级到7.4.0版本而不是7.4.1显然解决了这个问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72841429

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档