-
Notifications
You must be signed in to change notification settings - Fork 59
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 to prevent sync.services deprecation notice #487
Fix to prevent sync.services deprecation notice #487
Conversation
🦋 Changeset detectedLatest commit: 0788014 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
hey @stevennic-twilio, thanks for the PR, twilio-node has been bumped to v4, we can close this now. |
Hi @victoray, I did re-run a check on a local project with the updated dependencies released earlier ( The deprecation notice is version agnostic and does appear in the latest version of the twilio-node helper library (ref: https://github.com/twilio/twilio-node/blob/main/src/rest/Sync.ts#L9) and the Minimal steps to reproduce:
[...]
"dependencies": {
"@twilio/runtime-handler": "2.0.0",
"twilio": "^4.23.0"
},
"devDependencies": {
"twilio-run": "4.0.0"
},
[...]
exports.handler = function(context, event, callback) {
const twiml = new Twilio.twiml.VoiceResponse();
sync = Runtime.getSync();
twiml.say('Hello World!');
callback(null, twiml);
};
Expected result: The following log output: 200 GET /hello-world │ Response Type text/xml; charset=utf-8 Actual result: The following log output: services is deprecated. Use v1.services instead.
200 GET /hello-world │ Response Type text/xml; charset=utf-8 Workaround for local environment:
In my testing, the workaround above only works for local testing. While deployed, the alert will remain. |
hi @stevennic-twilio, can you add a changeset to this PR ? |
fix(twilio-run): add changeset
Congratulations on your first contribution to the Serverless Toolkit! |
While using Twilio-node v4.x+ in a Function, calling
getSync(<ServiceName>)
also prints out the warningservices is deprecated. Use v1.services instead.
.These PR simply adds
.v1
to the existingclient.sync.services[...]
code.The current default Twilio-node version for new Serverless Services (v3.29.2) does appear to include the option for
client.sync.v1.services[...]
as well.Contributing to Twilio