twilio / twilio-voice-react-native

Other
62 stars 22 forks source link

[VBLOCKS-2964] Update `@twilio/voice-errors` to `1.6.0` #378

Closed mhuynh5757 closed 1 week ago

mhuynh5757 commented 3 weeks ago

Submission Checklist

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

Description

This PR updates the @twilio/voice-errors package to 1.6.0. It also adds relevant CallMessage errors to the generated errors: 31210 and 31211.

Breakdown

Validation

Scenarios:

const validMessage = new CallMessage({
  content: 'some string',
  contentType: 'application/json',
  messageType: 'user-defined-message',
});

const largeMessage = new CallMessage({
  content: MESSAGE_CONTENT_EXCEEDING_MAX_PAYLOAD_SIZE,
  // this is a 10k+ length string
  contentType: 'application/json',
  messageType: 'user-defined-message',
});

const invalidContentTypeMessage = new CallMessage({
  content: { foo: 'bar' },
  contentType: 'not a real content type foobar',
  messageType: 'user-defined-message',
});

const invalidMessageTypeMessage = new CallMessage({
  content: { foo: 'bar' },
  contentType: 'application/json',
  messageType: 'not a real message type foobar',
});

Results:

Scenario iOS Android
Valid Message Success, no error Success, no error
Large Message Fail, neither error callback or success callback fired Success, error raised to JS
Invalid Content Type Fail? success callback fired Fail? success callback fired
Invalid Message Type Success, error raised to JS Success, error raised to JS

Additional Notes

N/A