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: secure message draft saving [WPB-11325] #3061

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Conversation

Garzas
Copy link
Contributor

@Garzas Garzas commented Oct 14, 2024

BugWPB-11325 [Android] Can not open conversations


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

There were situations when saving message draft cause error in db android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787)

Causes (Optional)

Not working conversations when there was some saved draft

Solutions

Secure draft saving with checks needed to save a draft

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

  1. Start typing message in conversation with some reply or editting message
  2. Remove on web message only for you which you are editing or replying to
  3. continue typing on android
  4. there should not be any issues with db on logs

@Garzas Garzas requested review from yamilmedina, borichellow, saleniuk and a team October 14, 2024 13:43
@Garzas Garzas self-assigned this Oct 14, 2024
@Garzas Garzas requested review from ohassine and mathias-niboulies and removed request for a team October 14, 2024 13:43
@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Oct 14, 2024
Copy link
Contributor

github-actions bot commented Oct 14, 2024

Test Results

3 238 tests  +3   3 132 ✅ +3   4m 16s ⏱️ +17s
  552 suites ±0     106 💤 ±0 
  552 files   ±0       0 ❌ ±0 

Results for commit d29aa58. ± Comparison against base commit cf44646.

♻️ This comment has been updated with latest results.

@codecov-commenter
Copy link

codecov-commenter commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.51%. Comparing base (cf44646) to head (d29aa58).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3061      +/-   ##
===========================================
+ Coverage    52.24%   52.51%   +0.27%     
===========================================
  Files         1314     1314              
  Lines        50951    51013      +62     
  Branches      4724     4734      +10     
===========================================
+ Hits         26617    26788     +171     
+ Misses       22439    22327     -112     
- Partials      1895     1898       +3     
Files with missing lines Coverage Δ
...rsistence/dao/message/draft/MessageDraftDAOImpl.kt 83.33% <100.00%> (+13.33%) ⬆️
.../wire/kalium/persistence/db/UserDatabaseBuilder.kt 80.64% <100.00%> (+0.25%) ⬆️

... and 5 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 cf44646...d29aa58. Read the comment docs.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Oct 14, 2024

Datadog Report

Branch report: fix/save-message-draft
Commit report: fb3a981
Test service: kalium-jvm

✅ 0 Failed, 3132 Passed, 106 Skipped, 16.99s Total Time

Copy link
Contributor

github-actions bot commented Oct 14, 2024

🐰 Bencher Report

Branchfix/save-message-draft
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
680,692.80
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
602,356,255.54
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
927,527,595.46
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,590,099.54
🐰 View full continuous benchmarking report in Bencher

Copy link

@Garzas Garzas added this pull request to the merge queue Oct 15, 2024
Merged via the queue into develop with commit a47607d Oct 15, 2024
22 checks passed
@Garzas Garzas deleted the fix/save-message-draft branch October 15, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: unplanned Any work item that isn’t part of the product or technical roadmap. 👕 size: S type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants