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: handle conversation access update event (WPB-10850) 🍒 #2982

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 30, 2024

BugWPB-10850 [Android] Updating access roles from web not reflected on android

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

Original PR description:



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 receiving conversation.access-update we were not handling properly from sync

Causes (Optional)

Not implemented

Solutions

Add AccessUpdateEventHandler to handle events for conversation.access-update and properly update conversation access roles

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

  • Run with AR
  • create a group
  • from WEB change GUESTS / SERVICES
  • changes are reflected on Android

* feat: add mappers from api to model and from model to dao for access update event

* feat: add correct receiving values for access update (access and accessRole)

* feat: create handler for access update event received and its usage

* feat: add return of Either for access update handler

* feat: rename handler to remove redundant conversation

* feat: rename clashing function naming

* test: add tests for receiving access update event

* chore: rename mapper method naming

* test: add test for new mappings in ConversationMapper

* chore: renaming of access update event handler

* test: add tests for AccessUpdateHandler
@alexandreferris alexandreferris requested review from a team, alexandreferris, borichellow, vitorhugods, Garzas and ohassine and removed request for a team August 31, 2024 08:48
Copy link

sonarcloud bot commented Aug 31, 2024

Copy link
Contributor Author

github-actions bot commented Aug 31, 2024

Test Results

3 193 tests  +6   3 088 ✔️ +6   3m 54s ⏱️ +18s
   549 suites +1      105 💤 ±0 
   549 files   +1          0 ±0 

Results for commit 2eee6dc. ± Comparison against base commit 1549f4c.

This pull request removes 1 and adds 7 tests. Note that renamed tests count towards both.
com.wire.kalium.logic.sync.receiver.ConversationEventReceiverTest ‑ givenAccessUpdateEvent_whenOnEventInvoked_thenReturnSuccess[jvm]
com.wire.kalium.logic.data.conversation.ConversationMapperTest ‑ givenAccessList_whenMappingFromApiModelToAccessModel_thenCorrectValuesShouldBeReturned[jvm]
com.wire.kalium.logic.data.conversation.ConversationMapperTest ‑ givenAccessList_whenMappingFromModelToDAOAccess_thenCorrectValuesShouldBeReturned[jvm]
com.wire.kalium.logic.data.conversation.ConversationMapperTest ‑ givenAccessRoleList_whenMappingFromApiModelToAccessModel_thenCorrectValuesShouldBeReturned[jvm]
com.wire.kalium.logic.data.conversation.ConversationMapperTest ‑ givenAccessRoleList_whenMappingFromModelToDAOAccessRole_thenCorrectValuesShouldBeReturned[jvm]
com.wire.kalium.logic.sync.receiver.ConversationEventReceiverTest ‑ givenAccessUpdateEventAndHandlingFails_whenOnEventInvoked_thenHandlerPropagateFails[jvm]
com.wire.kalium.logic.sync.receiver.ConversationEventReceiverTest ‑ givenAccessUpdateEventAndHandlingSucceeds_whenOnEventInvoked_thenSuccessHandlerResult[jvm]
com.wire.kalium.logic.sync.receiver.conversation.AccessUpdateHandlerTest ‑ givenConversationAccessUpdateEvent_whenHandlingIt_thenShouldCallUpdateDatabase[jvm]

♻️ This comment has been updated with latest results.

Copy link
Contributor Author

🐰Bencher

ReportSat, August 31, 2024 at 09:03:34 UTC
Projectkalium
Branchfeat/handle_conversation_access_update_event-cherry-pick
Testbedubuntu-latest

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

  • Latency (latency)

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
BenchmarkLatencyLatency Results
nanoseconds (ns)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles➖ (view plot)681,029.78
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory➖ (view plot)387,432,849.06
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark➖ (view plot)922,717,839.87
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark➖ (view plot)21,264,176.38

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 76.74419% with 10 lines in your changes missing coverage. Please review.

Project coverage is 52.52%. Comparing base (1549f4c) to head (2eee6dc).

Files with missing lines Patch % Lines
...in/com/wire/kalium/logic/data/event/EventMapper.kt 20.00% 8 Missing ⚠️
.../receiver/conversation/AccessUpdateEventHandler.kt 80.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2982      +/-   ##
===========================================
+ Coverage    52.50%   52.52%   +0.02%     
===========================================
  Files         1295     1296       +1     
  Lines        49779    49816      +37     
  Branches      4642     4644       +2     
===========================================
+ Hits         26137    26167      +30     
- Misses       21767    21775       +8     
+ Partials      1875     1874       -1     
Files with missing lines Coverage Δ
...lium/logic/data/conversation/ConversationMapper.kt 62.43% <100.00%> (+3.51%) ⬆️
...n/kotlin/com/wire/kalium/logic/data/event/Event.kt 78.17% <100.00%> (+0.04%) ⬆️
...m/logic/sync/receiver/ConversationEventReceiver.kt 94.23% <100.00%> (ø)
.../receiver/conversation/AccessUpdateEventHandler.kt 80.00% <80.00%> (ø)
...in/com/wire/kalium/logic/data/event/EventMapper.kt 21.93% <20.00%> (-0.25%) ⬇️

... and 4 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 1549f4c...2eee6dc. Read the comment docs.

@datadog-wireapp
Copy link

Datadog Report

Branch report: feat/handle_conversation_access_update_event-cherry-pick
Commit report: 256cd95
Test service: kalium-jvm

✅ 0 Failed, 3088 Passed, 105 Skipped, 12.54s Total Time

@alexandreferris alexandreferris added this pull request to the merge queue Sep 2, 2024
Merged via the queue into develop with commit dd8b1dc Sep 2, 2024
22 checks passed
@alexandreferris alexandreferris deleted the feat/handle_conversation_access_update_event-cherry-pick branch September 2, 2024 07:32
@echoes-hq echoes-hq bot added the echoes: bugs Technical or functional defects in the product label Sep 3, 2024
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: bugs Technical or functional defects in the product 🚨 Potential breaking changes 👕 size: L type: feature ✨
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants