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

离开页面时调用 window.$harbor.onOfflineLog('upload') 后,应该只上传了部分数据,rrweb 在回放中没有显示 #227

Open
4 tasks done
qiushaocloud opened this issue Jul 10, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@qiushaocloud
Copy link

Describe the bug

离开页面时调用 window.$harbor.onOfflineLog('upload') 后,应该只上传了部分数据,rrweb 在回放中没有显示,希望能支持 navigator.sendBeacon 方式上传,如: window.$harbor.onOfflineLog('upload', {sendBeacon: true}) ,用于处理关闭页面/刷新等时自动上传回放数据

参考资料:https://cloud.tencent.com/developer/article/1423882

Steps to reproduce

No response

System Info

mac chrome

Logs

No response

Validations

@qiushaocloud qiushaocloud added the bug Something isn't working label Jul 10, 2024
@wqcstrong
Copy link
Collaborator

beacon 的诸多限制决定了不适用:https://www.w3.org/TR/beacon/#privacy-and-security

@qiushaocloud
Copy link
Author

有些浏览器是能支持的,是否可以考虑做成,如果支持则使用,不支持则保持原有的,而且这通过参数控制,对有需要的人才会有用?

@wqcstrong
Copy link
Collaborator

不是兼容性问题,beacon 的兼容性挺好的,但不适合发大体积数据

@qiushaocloud
Copy link
Author

大小问题可以采用分片上传方式解决

@wqcstrong
Copy link
Collaborator

sendBeacon 和分片上传这两个放在一起,就很难评 😄

我的建议是上传数据不建议放在关闭窗口的时候,欢迎说说你的实际场景,可能有其他解决方案

@qiushaocloud
Copy link
Author

我这边的需求是不需要用户主动点击按钮就能上传回放日志,提供可以调试的链接给用户后,用户可能在任意时间点进行测试,因此实时调试不太现实,需要使用回放方式,而如果定时上传,会有大量重复的回放,我看了,每次上传都是全量上传,每次都会生成一个回放

因此我才想在关闭的时候能够进行上传

@wqcstrong
Copy link
Collaborator

我们正在推进 支持上传一段时间的日志数据,还请保持关注。

@qiushaocloud
Copy link
Author

好的,如果支持后麻烦在此恢复一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants