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: make some conversation models serializable, add serializer for Any primitive type [WPB-14433] #3130

Merged

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Nov 26, 2024

BugWPB-14433 [Android] Crash after longtapping on a conversation and putting phone to sleep


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 saving conversation menu state, models cannot be saved into bundle resulting in a crash.

Solutions

In order to save conversation menu state, models must be able to be saved, so the best way is to use kotlin serialization.

  • added serializer for Any type representing primitive types like boolean, string, int, float, etc.
  • added serialization for selected conversation-related models

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.

@echoes-hq echoes-hq bot added the echoes: unplanned Any work item that isn’t part of the product or technical roadmap. label Nov 26, 2024
@saleniuk saleniuk requested review from a team, m-zagorski, yamilmedina, MohamadJaara, vitorhugods and ohassine and removed request for a team November 26, 2024 18:03
Copy link
Contributor

github-actions bot commented Nov 26, 2024

Test Results

3 267 tests  ±0   3 160 ✅ ±0   4m 33s ⏱️ -23s
  557 suites ±0     107 💤 ±0 
  557 files   ±0       0 ❌ ±0 

Results for commit 5729647. ± Comparison against base commit a307ae3.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Nov 26, 2024

Datadog Report

Branch report: fix/add-serialization-for-conversation-models
Commit report: 35d1e3c
Test service: kalium-jvm

✅ 0 Failed, 3160 Passed, 107 Skipped, 30.47s Total Time

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.

Project coverage is 52.66%. Comparing base (a307ae3) to head (5729647).

Files with missing lines Patch % Lines
...re.kalium.util/serialization/SerializationUtils.kt 0.00% 12 Missing ⚠️
...ire/kalium/logic/data/conversation/Conversation.kt 0.00% 9 Missing ⚠️
...tlin/com/wire/kalium/logic/data/message/Message.kt 0.00% 7 Missing ⚠️
...lium/logic/data/conversation/ConversationStatus.kt 0.00% 5 Missing ⚠️
...alium/logic/data/message/mention/MessageMention.kt 0.00% 5 Missing ⚠️
...in/com/wire/kalium/logic/data/event/EventMapper.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           release/candidate    #3130      +/-   ##
=====================================================
- Coverage              52.69%   52.66%   -0.04%     
=====================================================
  Files                   1322     1322              
  Lines                  51662    51694      +32     
  Branches                4781     4790       +9     
=====================================================
- Hits                   27225    27223       -2     
- Misses                 22480    22513      +33     
- Partials                1957     1958       +1     
Files with missing lines Coverage Δ
...in/com/wire/kalium/logic/data/event/EventMapper.kt 21.93% <0.00%> (ø)
...lium/logic/data/conversation/ConversationStatus.kt 0.00% <0.00%> (ø)
...alium/logic/data/message/mention/MessageMention.kt 0.00% <0.00%> (ø)
...tlin/com/wire/kalium/logic/data/message/Message.kt 0.00% <0.00%> (ø)
...ire/kalium/logic/data/conversation/Conversation.kt 0.00% <0.00%> (ø)
...re.kalium.util/serialization/SerializationUtils.kt 45.45% <0.00%> (-25.98%) ⬇️

... and 2 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 a307ae3...5729647. Read the comment docs.

@MohamadJaara MohamadJaara added this pull request to the merge queue Nov 27, 2024
Merged via the queue into release/candidate with commit 76f6cd1 Nov 27, 2024
20 checks passed
@MohamadJaara MohamadJaara deleted the fix/add-serialization-for-conversation-models branch November 27, 2024 11:04
github-actions bot pushed a commit that referenced this pull request Nov 27, 2024
…ny primitive type [WPB-14433] (#3130)

* fix: add serializer for Any type holding primitive values

* fix: add serialization for selected conversation models

* fix detekt issues

* fix test
github-merge-queue bot pushed a commit that referenced this pull request Nov 28, 2024
…ny primitive type [WPB-14433] 🍒 (#3133)

* fix: make some conversation models serializable, add serializer for Any primitive type [WPB-14433] (#3130)

* fix: add serializer for Any type holding primitive values

* fix: add serialization for selected conversation models

* fix detekt issues

* fix test

* trigger build

---------

Co-authored-by: Michał Saleniuk <[email protected]>
Co-authored-by: Michał Saleniuk <[email protected]>
@mastaab mastaab added echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. and removed echoes: unplanned Any work item that isn’t part of the product or technical roadmap. labels 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: S type: bug / fix 🐞
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants