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

@findify/sdk: Uncaught error when send times out #864

Open
simonlovesyou opened this issue Nov 4, 2022 · 3 comments
Open

@findify/sdk: Uncaught error when send times out #864

simonlovesyou opened this issue Nov 4, 2022 · 3 comments
Assignees

Comments

@simonlovesyou
Copy link

Issue

We've noticed recently that findify crashes intermittently when we're trying to retrieve a smart collection, recommendations etc with the following error:

Cannot read properties of undefined (reading 'status')

I've debugged it on our end and seems like it crashes in packages/sdk/src/utils.ts#L24 when the error it catches is a "timeout error" and the error does not contain a response
Screenshot 2022-11-04 at 10 45 00
err in packages/sdk/src/utils.ts that does not contain response

Steps to reproduce

Go to some website (e.g. matsmart.se/) and navigate around and hope that the findify client .send times out. If so you should be able to see the error in the web developer console.

Versions

  • @findify/sdk: v2.5.9

Screenshots

Screenshot 2022-11-04 at 10 47 15

Expected

That @findify/sdk can gracefully handle their errors

Actual

Errors internal to @findify/sdk propagate and are uncaught by the lib.

Link to project

Affects all matsmart/motatos webpages:

Browser Name and version

Chrome Version 106.0.5249.119 (Official Build) (arm64)

Operating system

macOS 12.6 (21G115)

Suggested fix

Properly type "err" and check if response exists on err before reading response

@simonlovesyou simonlovesyou changed the title @findify/sdk: Uncaught error when sdk send times out @findify/sdk: Uncaught error when send times out Nov 4, 2022
@simonlovesyou
Copy link
Author

Any eyes on this from the maintainers? @wolff95 ?

@wolff95
Copy link
Contributor

wolff95 commented Nov 28, 2022

Hello Simon, sorry for the late response!

I'll investigate on this and let you know, but so far, couldn't reproduce it.
Anyhow I'll better handle the error to not crash it.

@wolff95 wolff95 self-assigned this Nov 28, 2022
@wolff95
Copy link
Contributor

wolff95 commented Dec 1, 2022

Hello Simon, I have pushed a new version with a simple nullcheck.
In later iteration the error will be handled better, but this should be enough to solve your issue.

2.5.10

Let me know if it works out.

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