Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforePushBreadcrumb 中存在类型事件,也会导致死循环。 #50

Open
quiet-wuxiao opened this issue Dec 30, 2021 · 3 comments

Comments

@quiet-wuxiao
Copy link

Describe the bug

 let result: BreadcrumbPushData = null
      // 如果用户输入console,并且logger是打开的会造成无限递归,
      // 应该加入一个开关,执行这个函数前,把监听console的行为关掉
      const beforePushBreadcrumb = this.beforePushBreadcrumb
      slientConsoleScope(() => {
        result = beforePushBreadcrumb(this, data)
      })

这里只处理 console 死循环的情况;
假如 beforePushBreadcrumb,存在模拟点击,http 请求等,也会出现死循环的情况。

Information

  • Mitojs Version 2.1.50
  • Environment: Vue2.6
@linxiaodi
Copy link
Collaborator

没大懂这个假设的情况。这个是immediatePush会触发下面的一个log导致,不停的push而考虑进去的。理论上模拟点击和http请求不会触发这个情况

@quiet-wuxiao
Copy link
Author

假设,beforePushBreadcrumb 内部,存在 模拟点击 和 xhr 请求 代码。xhr 请求会监听事件,再次调用 Breadcrumb.push 函数,他们俩个会行为一个死循环

@linxiaodi
Copy link
Collaborator

假设,beforePushBreadcrumb 内部,存在 模拟点击 和 xhr 请求 代码。xhr 请求会监听事件,再次调用 Breadcrumb.push 函数,他们俩个会行为一个死循环

确实会存在这类问题,之后会做一次优化

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants