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

Updating from major version 3.x.x to 4.x.x Breaks Data Contracts #960

Closed
funkeyfreak opened this issue Sep 29, 2023 · 2 comments
Closed
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library

Comments

@funkeyfreak
Copy link

When upgrading from twilio v3.64.0 to twilio v4.13.0, our team encountered what may have been an API-breaking change introduced by a change in generator usage. What we observed is a change in how the properties on the ParticipantListInstanceCreateOptions data contract are represented. In v3.64.0, these properties were represented using nested dot notation, whereas in v4.13.0, these properties are represented in bracket notation. In particular, the messageBinding property contains nested properties - these were fundamentally changed between these two library versions. See below for the declaration details of ParticipantListInstanceCreateOptions from the untared packages:

In twilio@3.64.0 /lib/rest/converstaions/v1/conversation/participant.d.ts

/**
 * Options to pass to create
 *
 * @property attributes - An optional string metadata field you can use to store any data you wish.
 * @property dateCreated - The date that this resource was created.
 * @property dateUpdated - The date that this resource was last updated.
 * @property identity - A unique string identifier for the conversation participant as Conversation User.
 * @property messagingBinding.address - The address of the participant's device.
 * @property messagingBinding.projectedAddress - The address of the Twilio phone number that is used in Group MMS.
 * @property messagingBinding.proxyAddress - The address of the Twilio phone number that the participant is in contact with.
 * @property roleSid - The SID of a conversation-level Role to assign to the participant
 * @property xTwilioWebhookEnabled - The X-Twilio-Webhook-Enabled HTTP request header
 */
interface ParticipantListInstanceCreateOptions {
  attributes?: string;
  dateCreated?: Date;
  dateUpdated?: Date;
  identity?: string;
  messagingBinding?: {
    address?: string;
    proxyAddress?: string;
    projectedAddress?: string;
  };
  roleSid?: string;
  xTwilioWebhookEnabled?: ParticipantWebhookEnabledType;
}

In twilio@4.64.0 /lib/rest/converstaions/v1/conversation/participant.d.ts

/**
 * Options to pass to create a ParticipantInstance
 */
export interface ParticipantListInstanceCreateOptions {
    /** The X-Twilio-Webhook-Enabled HTTP request header */
    xTwilioWebhookEnabled?: ParticipantWebhookEnabledType;
    /** A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. */
    identity?: string;
    /** The address of the participant\\\'s device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the \\\'identity\\\' field). */
    "messagingBinding.address"?: string;
    /** The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the \\\'identity\\\' field). */
    "messagingBinding.proxyAddress"?: string;
    /** The date that this resource was created. */
    dateCreated?: Date;
    /** The date that this resource was last updated. */
    dateUpdated?: Date;
    /** An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified.  **Note** that if the attributes are not set \\\"{}\\\" will be returned. */
    attributes?: string;
    /** The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. */
    "messagingBinding.projectedAddress"?: string;
    /** The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. */
    roleSid?: string;
}

We heavily use Twilio's SDKs and services to create, manage, and store chat and communication data between one or more participants in our application. This change came as a surprise, as it was not represented (to the best of our knowledge) in 3.x to 4.x upgrade guide. Are there any other locations with similar changes that we should know of?

Exception/Log

Unless one is directly importing ParticipantListInstanceCreateOptions from the twilio library, one will receive the following error

50204: Identity not provided

Technical details:

  • twilio-node version: v4.13.0
  • node version: v18.16.0
@funkeyfreak funkeyfreak changed the title Updating from major version 3.x.x to 4.x.x results in the breaking of several contracts. Updating from major version 3.x.x to 4.x.x Breaks Data Contracts Sep 29, 2023
@sbansla
Copy link
Contributor

sbansla commented Oct 12, 2023

@funkeyfreak Usually changes in api are mentioned in changes.md file

@sbansla sbansla added the type: question question directed at the library label Oct 12, 2023
@tiwarishubham635 tiwarishubham635 added the status: waiting for feedback waiting for feedback from the submitter label Apr 15, 2024
@tiwarishubham635
Copy link
Contributor

Closing this issue as no updates were received in last 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

3 participants