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: messages migration from proteus to mls [WPB-15149] #3218

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

Garzas
Copy link
Contributor

@Garzas Garzas commented Jan 8, 2025

BugWPB-15149 App is stuck after MLS migration


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

When moving messages from proteus conversation to MLS if some message contained reactions or RestrictedAsset then migration failed causing slow sync to break.

Solutions

Migrate MessageRestrictedAssetContent and Reaction tables to update on cascade when Message is changing conversation_id

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

  1. Before enabling mls add reactions to messages on 1on1 conversation
  2. Enable MLS for the team
  3. Trigger slow sync on both clients in the same 1on1 conversation
  4. App should not stuck on sync and user should see that current 1on1 conversation is using MLS protocol

Attachments (Optional)

Wire 2025-01-08 at 3_34 PM

Copy link

sonarqubecloud bot commented Jan 8, 2025

Copy link
Contributor

github-actions bot commented Jan 8, 2025

Test Results

3 347 tests  +1   3 239 ✅ +1   5m 9s ⏱️ -40s
  572 suites ±0     108 💤 ±0 
  572 files   ±0       0 ❌ ±0 

Results for commit bc52394. ± Comparison against base commit 70b8394.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Jan 8, 2025

Datadog Report

Branch report: fix/messages-to-mls-conv-migration
Commit report: 8422d75
Test service: kalium-jvm

✅ 0 Failed, 3239 Passed, 108 Skipped, 1m 3.04s Total Time
❄️ 1 New Flaky

New Flaky Tests (1)

  • givenPersistedClient_whenUpsertingTheSameExactClient_thenItShouldIgnoreAndNotNotifyOtherQueries[jvm] - com.wire.kalium.persistence.dao.client.ClientDAOTest - Last Failure

    Expand for error
     app.cash.turbine.TurbineAssertionError: Expected no events but found Item(Client(userId=test@domain, id=id0, deviceType=null, clientType=null, isValid=true, isProteusVerified=false, registrationDate=null, lastActive=null, label=null, model=null, mlsPublicKeys=null, isMLSCapable=false))
     
     app.cash.turbine.TurbineAssertionError: Expected no events but found Item(Client(userId=test@domain, id=id0, deviceType=null, clientType=null, isValid=true, isProteusVerified=false, registrationDate=null, lastActive=null, label=null, model=null, mlsPublicKeys=null, isMLSCapable=false))
     	at app//app.cash.turbine.TurbineAssertionError$Companion.invoke(TurbineAssertionError.kt:32)
     	at app//app.cash.turbine.ChannelKt.unexpectedEvent(channel.kt:253)
     	at app//app.cash.turbine.ChannelKt.expectNoEvents(channel.kt:71)
     	at app//app.cash.turbine.ChannelTurbine.expectNoEvents(Turbine.kt:192)
     	at app//app.cash.turbine.TurbineTestContextImpl.expectNoEvents(flow.kt)
     	at app//com.wire.kalium.persistence.dao.client.ClientDAOTest$givenPersistedClient_whenUpsertingTheSameExactClient_thenItShouldIgnoreAndNotNotifyOtherQueries$1$1.invokeSuspend(ClientDAOTest.kt:501)
     	at app//com.wire.kalium.persistence.dao.client.ClientDAOTest$givenPersistedClient_whenUpsertingTheSameExactClient_thenItShouldIgnoreAndNotNotifyOtherQueries$1$1.invoke(ClientDAOTest.kt)
     ...
    

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.51%. Comparing base (70b8394) to head (bc52394).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/candidate    #3218      +/-   ##
=====================================================
+ Coverage              54.17%   54.51%   +0.33%     
=====================================================
  Files                   1250     1250              
  Lines                  36514    36520       +6     
  Branches                3696     3696              
=====================================================
+ Hits                   19783    19908     +125     
+ Misses                 15304    15213      -91     
+ Partials                1427     1399      -28     
Files with missing lines Coverage Δ
...logic/feature/conversation/mls/OneOnOneMigrator.kt 92.85% <100.00%> (+0.66%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 70b8394...bc52394. Read the comment docs.

@Garzas Garzas added this pull request to the merge queue Jan 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 9, 2025
@Garzas Garzas added this pull request to the merge queue Jan 9, 2025
Merged via the queue into release/candidate with commit 3b96290 Jan 9, 2025
22 checks passed
@Garzas Garzas deleted the fix/messages-to-mls-conv-migration branch January 9, 2025 08:07
@echoes-hq echoes-hq bot added the echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants