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

fix: sub conversation epoch verification [WPB-15647] 🍒 #3247

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

github-actions[bot]
Copy link
Contributor

This PR was automatically cherry-picked based on the following PR:

Original PR description:


BugWPB-15647 [Android] epoch check for sub conversations is verifying the main conversation


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • 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

The previous implementation did not handle epoch verification for sub-conversations. As a result, the verification process always checked the parent conversation's epoch, leading to incorrect behavior when the sub-conversation epoch was out of sync while the parent conversation's epoch remained valid.

Causes

  1. Lack of Sub-Conversation Handling: Sub-conversations were not considered during epoch verification.
  2. Missing Models and Logic: There were no models or logic in place to support sub-conversation-specific checks.
  3. Incorrect Parent Conversation Focus: Epoch verification defaulted to the parent conversation, ignoring sub-conversations entirely.

Solutions

  1. Added verifySubConversationEpoch:

    • A dedicated method to verify epochs for sub-conversations, ensuring accurate context for verification.
  2. Sub-Conversation Repository Arrangement:

    • Created SubconversationRepositoryArrangement to mock and test sub-conversation-related methods efficiently.
  3. Introduced Sub-Conversation Models:

    • Added models in the logic module to handle sub-conversations as first-class entities.
  4. Updated Epoch Verification Logic:

    • Refactored NewMessageEventHandler to call verifySubConversationEpoch when a subConversationId is provided.
  5. Added Comprehensive Tests:

    • Verified that fetchConversation is not called when a subConversationId is present.
    • Ensured correct behavior for valid epochs, stale epochs, and failures.

* fix: sub conversation epoch verification

* test fix

* detekt fix

* test fix
@github-actions github-actions bot added cherry-pick PR is cherry-picking changes from another banch echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. type: bug / fix 🐞 👕 size: L 🚨 Potential breaking changes labels Jan 24, 2025
@Garzas Garzas requested review from MohamadJaara and typfel January 24, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick PR is cherry-picking changes from another banch echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. 🚨 Potential breaking changes 👕 size: L type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant