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

chore: Improve isSelfATeamMember UseCase (WPB-8978) #2924

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

alexandreferris
Copy link
Contributor

@alexandreferris alexandreferris commented Aug 1, 2024

TaskWPB-8978 [Android] Countly analytics ID and user properties


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 first trying to get if self user is a team member, it would return the default(false) value if sync was not done before.

Causes (Optional)

Sync was not done prior to the retrieval of this value.

Solutions

Add SlowSyncRepository and observe last sync complete before returning a value, so it will now always get the correct value for the user.

Dependencies (Optional)

Needs releases with:

  • PR for AR will follow

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Everything should continue running as is.

Copy link
Contributor

github-actions bot commented Aug 1, 2024

Test Results

3 144 tests  ±0   3 039 ✔️ ±0   3m 36s ⏱️ -16s
   539 suites ±0      105 💤 ±0 
   539 files   ±0          0 ±0 

Results for commit 3ae1701. ± Comparison against base commit 21725e7.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Aug 1, 2024

🐰Bencher

ReportThu, August 1, 2024 at 09:46:18 UTC
Projectkalium
Branchchore/improve_isSelfATeamMember
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)694,644.42
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory➖ (view plot)610,903,047.32
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark➖ (view plot)928,381,990.31
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark➖ (view plot)21,525,544.53

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

@datadog-wireapp
Copy link

Datadog Report

Branch report: chore/improve_isSelfATeamMember
Commit report: b9995af
Test service: kalium-jvm

✅ 0 Failed, 3039 Passed, 105 Skipped, 13.23s Total Time

@alexandreferris alexandreferris added this pull request to the merge queue Aug 1, 2024
Merged via the queue into develop with commit 9dbf5f5 Aug 1, 2024
22 checks passed
@alexandreferris alexandreferris deleted the chore/improve_isSelfATeamMember branch August 1, 2024 10:34
alexandreferris added a commit that referenced this pull request Aug 1, 2024
* chore: add slow sync repository to observe for last sync completion before returning default false value for isSelfATeamMember

* chore: add parameter for SlowSyncRepository for new usage

* tests: adjust existing tests for the usecase

(cherry picked from commit 9dbf5f5)
github-merge-queue bot pushed a commit that referenced this pull request Aug 2, 2024
* feat: Add Anonymous Analytics User Profile EPIC - (WPB-8978) (#2887)

* feat: add analytics user profile - Part 1 (WPB-8978) (#2868)

* feat: add method to set/insert tracking identifier into user metadata table

* feat: add MessageContent for DataTransfer with TrackingIdentifier

* feat: add DataTransferEventHandler to handle new data transfer events and set tracking identifier to user config metadata

* chore: remove needless blank line

* feat: add analytics user profile - Part 2 (WPB-8978) (#2877)

* feat: add method to set/insert tracking identifier into user metadata table

* feat: add MessageContent for DataTransfer with TrackingIdentifier

* feat: add DataTransferEventHandler to handle new data transfer events and set tracking identifier to user config metadata

* chore: remove needless blank line

* feat: add get for current tracking identifier and get and set for previous tracking identifier

* feat: add usage and logic handling for current and previous tracking identifiers

* feat: add tests

* feat: add better handling of receiving already existing tracking id and tests

* feat: add new analytics logger to kalium logger

* feat: add usecase to observe analytics tracking identifier

* feat: add tests for observeAnalyticsTrackingIdentifierStatus

* feat: add none AnalyticsIdentifierResult to be used in AR and remove abstract attribute

* feat: add proper mapping to observer result and verification on Either Left is tracking identifier already exists

* feat: add tests for observer with new logic

* chore: add user scope logger

* chore: add `as` instantiation of right value for usecase result

* feat: move AnalyticsIdentifierResult to new data module and update its usages

* feat: add usecase to delete previous tracking identifier

* chore: add missing imports

* test: add test for DeletePreviousTrackingIdentifierUseCase

* chore: remove delete previous tracking identifier use case

* feat: add extra sealed interface for better handling of analytics identifier result

* feat: add AnalyticsIdentifierManager to handle migration complete and propagating tracking identifier

* chore: add missing extension from new sealed interface

* test: add tests for AnalyticsIdentifierManager

* chore: adjust detekt

* chore: remove unused import

* chore: rename user config current tracking identifier

* chore: add docs

(cherry picked from commit f534d36)

* feat: Add packing and sending DataTransfer message - (WPB-8978) (#2896)

* feat: add syncManager to AnalyticsIdentifierManager in order to wait for current device to be available

* feat: add implementation of packDataTransfer message

* test: add tests

(cherry picked from commit 337c415)

* chore: Improve isSelfATeamMember UseCase (WPB-8978) (#2924)

* chore: add slow sync repository to observe for last sync completion before returning default false value for isSelfATeamMember

* chore: add parameter for SlowSyncRepository for new usage

* tests: adjust existing tests for the usecase

(cherry picked from commit 9dbf5f5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants