Skip to content

types(chat): narrow IMessage.messageType using literal union types#16981

Open
nitin-kumar-code wants to merge 1 commit intojitsi:masterfrom
nitin-kumar-code:types/chat-message-type-union
Open

types(chat): narrow IMessage.messageType using literal union types#16981
nitin-kumar-code wants to merge 1 commit intojitsi:masterfrom
nitin-kumar-code:types/chat-message-type-union

Conversation

@nitin-kumar-code
Copy link
Contributor

This PR improves type safety in the chat feature by narrowing
IMessage.messageType to a literal union of the defined message types.

Changes:

  • Marked MESSAGE_TYPE_* constants with as const
  • Introduced a ChatMessageType union type
  • Updated IMessage.messageType to use the union
  • Aligned action typings to use the new type

Tested locally:

  • Chat messages render correctly
  • Sending local, remote and error messages works as before
  • No type errors or lint warnings

No runtime behavior changes were introduced.

This prevents accidental use of invalid messageType values,
strengthens the chat data model, and improves maintainability.

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@nitin-kumar-code
Copy link
Contributor Author

Hi @saghul, @damencho
Could you please review and let me know if any changes are required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants