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

feat: add UnknownStrategy enum for future-proofing #89

Merged

Conversation

vitorhugods
Copy link
Member


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

When introducing some message types, clients that are not ready to receive them yet might react in improper ways.

iOS warns about all received unknown messages while Android and Web ignore unknown message types.

This isn't currently unified between clients and there's no way of choosing a different approach depending on the newly introduced message type.

Solutions

As proposed in the internal RFC, add a new field called unknownStrategy to be sent beside the actual message content. If content is NULL/NONE, the unknownStrategy can give a hint of what to do and how to handle such message.


PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Introduced UnknownStrategy enum to handle future-proofing for new OTR message types. Added it as an optional field to the MessageType oneof, with three handling strategies: IGNORE, DISCARD_AND_WARN, and WARN_USER_ALLOW_RETRY. This update aligns with the internal RFC on improving future-proofing.
Copy link
Member

@MohamadJaara MohamadJaara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Having it outside was breaking typescript code generation as it didn't like top-level enums for whatever reason
Copy link

sonarqubecloud bot commented Sep 2, 2024

@vitorhugods vitorhugods merged commit 5cf198b into master Sep 2, 2024
4 checks passed
@vitorhugods vitorhugods deleted the feat/improve-future-proofing-for-new-message-types branch September 2, 2024 10:27
@echoes-hq echoes-hq bot added the echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date. label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap Work aligned with the customer-announced roadmap, targeting a specific release date.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants