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

fix: client side errors from unexpected null/undefined values #3129

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

mixu3
Copy link

@mixu3 mixu3 commented Mar 6, 2025

Overview

This PR contains possible fixes for two types of client side errors.

(1) We received type errors that could not be reproduced that look like this:
error: Cannot read properties of null (reading 'getCoordinateSystems') stackTrace: TypeError: Cannot read properties of null (reading 'getCoordinateSystems')

This means that the ExtensionAPI was null somewhere in the code. Adding these null checks (!api) are harmless and will hopefully prevent these errors from occurring again.

(2) We received another type error when trying to read $metadata:
error: Cannot read properties of undefined (reading 'httpStatusCode') stackTrace: TypeError: Cannot read properties of undefined (reading 'httpStatusCode')

Changes for this include explicitly typing errors as IoTSiteWiseServiceExceptions and setting the errorCode to the error name (it was never supposed to be the http status code in the first place)

Verifying Changes

  • Nothing broke from manual testing in storybooks
  • Can successfully add, copy, and delete trend cursors in charts
  • npm run test in source-iotsitewise package was successful

Legal

This project is available under the Apache 2.0 License.

@mixu3 mixu3 merged commit a521efb into rc Mar 7, 2025
23 of 24 checks passed
@mixu3 mixu3 deleted the fix/client-side-errors branch March 7, 2025 18:26
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

Successfully merging this pull request may close these issues.

2 participants