-
Notifications
You must be signed in to change notification settings - Fork 886
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
heartbeatService.ts: cannot read properties of undefined (reading 'length') #7736
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @malk90, I wasn't able to reproduce this with my own test app. Could you provide a reproducible test app or the code that causes this behavior? Thanks! |
There seems to be a potential scenario in the heartbeat service running in the Opera browser (#7736) that the heartbeatCache exists but it's an empty object. The code implementation encounters errors in these cases as it assumes the heartbeatCache has a heartbeats array. This change better detects these empty object cases and treats them in a similar way as if there's nothing in the heartbeatCache.
hi, no, unfortunately I can’t help with the code, but if you look at the code, you’ll immediately see the error |
Hi @malk90, We still couldn't reproduce this issue, unfortunately. However, we just shipped v10.6.0 which includes some better checks around the state of the HeartBeat object that should avoid the error that you're seeing. Could you please give the new release a test? If you still encounter issues then could you post a minimum reproducible test case so we can better attempt to reproduce the probelm ourselves? Thanks! |
There seems to be a potential scenario in the heartbeat service running in the Opera browser (#7736) that the heartbeatCache exists but it's an empty object. The code implementation encounters errors in these cases as it assumes the heartbeatCache has a heartbeats array. This change better detects these empty object cases and treats them in a similar way as if there's nothing in the heartbeatCache.
there are significantly fewer errors, perhaps not everyone has switched to the new version yet
I think we need more time, I’ll write back a little later, but I would still add checks if null for 'heartbeatService'. Thanks! |
Hi @malk90, We've put some more protections in the upcoming release of 10.7.0 which should be released soon. I'll post here when it's out. Thanks! |
Hi @malk90, v10.7.0 was released on Monday. Can you check to see if this clears up your issue? Thanks. |
Hey @malk90. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
I'm going to close this issue since we released a change to address this issue and we haven't heard if it's still affecting your app after an upgrade. If you find that the issue persists at a later time, please create a new GitHub issue and link to this one. Thank you! |
Operating System
Windows >=10
Browser Version
Opera 102.0.0
Firebase SDK Version
10.5.2
Firebase SDK Product:
Analytics, Auth, Messaging, Performance
Describe your project's tooling
React app with webpack, cordova, typescript
Describe the problem
Opera users have repeated errors from time to time, most of all in version 102, but it started with 101
In file /node_modules/@firebase/app/src/heartbeatService.ts line 132 error
Cannot read properties of undefined (reading 'length')
this._heartbeatsCache.heartbeats.length === 0
Steps and code to reproduce issue
firebase-js-sdk/packages/app/src/heartbeatService.ts
Line 132 in 12ad9f1
The text was updated successfully, but these errors were encountered: