Troubleshooting
Overview
This guide helps you resolve common issues that may arise when working with the Optave Assistant for Salesforce.
Common Issues
Authentication Problems
Issue: Unable to authenticate or retrieve JWT token
Resolution:
- Verify that Named Credentials are correctly configured
- Check that External Credentials have the correct client ID and client secret
- Ensure the formula in the Authorization header is correctly formatted
WebSocket Connection Issues
Issue: WebSocket connection fails or disconnects frequently
Resolution:
- Verify the WebSocket URL in the Custom Metadata record
- Check the browser console for CORS-related errors
- Ensure the WebSocket URL is accessible from your Salesforce org
- Verify network connectivity and any proxy settings that might affect WebSocket connections
CORS and Whitelist Issues
Issue: Cross-Origin Resource Sharing (CORS) restrictions
Resolution:
- Navigate to Setup > CORS in your Salesforce org
- Add all necessary domains to the whitelist:
- Optave API domain
- WebSocket domain
- Any other external resources used by the assistant
- Restart your browser after making changes
Dependency Update Issues
Issue: Problems after updating dependent libraries or packages
Resolution:
- Since Salesforce doesn't support npm packages directly, any updates to dependencies must be manually uploaded as minified files to Static Resources. For example, for a new version of the Optave JavaScript SDK, manually minify the SDK (or install the npm package in a test project and locate the file at node_modules/@optave/dist/optave.client.sdk.js) and then upload it.
- Ensure compatibility between all library versions
- Clear browser cache after updating static resources