Closed
Conversation
minademian
suggested changes
Oct 10, 2022
Contributor
minademian
left a comment
There was a problem hiding this comment.
Tested the branch locally with a fresh ngrok URL. The phone call flow still doesn’t work.
- no database errors in console, still reports: "Database connection established successfully."
- 403 error on /voice API call in Twilio errors
When I turned off request validation for the /voice API call (passing {validate: false}) and tested the phone call flow again, I got the following error in the console:
/voice: callSid: CAec2c41d72d724072b9f30a02c8efce8f
Executing (default): select * from worker where contact_uri='+46736455849'
contact_uriExists: workerSid CAab6f4359b5f4c8f0feb8aaebfea77777
workerSid!=null: true
updateWorkerActivity: getting workerSid from database
Executing (default): select * from worker where contact_uri='+46736455849'
updateWorkerActivity: workerSid is CAab6f4359b5f4c8f0feb8aaebfea77777
updateWorkerFromSid: error updating worker activity: Error: The requested resource /Workspaces/WS61afa2202c9adfbb4a245f6bc3c8495c/Workers/CAab6f4359b5f4c8f0feb8aaebfea77777 was not found
updateWorkerFromSid error: TypeError: Cannot read properties of undefined (reading 'activityName')
/Users/minademian/code/vent-taskrouter/src/lib/worker.js:83
workerEntity.friendlyName
^
TypeError: Cannot read properties of undefined (reading 'friendlyName')
at Worker.updateWorkerActivity (/Users/minademian/code/vent-taskrouter/src/lib/worker.js:83:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/minademian/code/vent-taskrouter/src/server.js:411:20
[nodemon] app crashed - waiting for file changes before starting...| if (!this._instance){ | ||
| this._instance = new Database(); | ||
| } | ||
| return this._instance; |
Contributor
There was a problem hiding this comment.
not sure how this would work in theory - static methods don’t have access to this, they’re class methods. this refers to instance methods...
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I resolved the issue regarding database singleton instantiation. Basically, the constructor was never getting called. I followed the pattern for an ES6 singleton as described in : https://code.tutsplus.com/tutorials/how-to-implement-the-singleton-pattern-in-javascript-es6--cms-39927
Also made a few changes to sms.js because it was failing during testing, but I'll stop there and do the rest of that work on a different branch once we merge this one.