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

refactor: remove user scoped shared pref and store all feature flags in the metadata user DB table #2235

Closed

Conversation

MohamadJaara
Copy link
Member


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

as agreed on while ago to remove the user scoped shared pref file, it was not done before because we did not have the ability to restart sync aka sync version

Solutions

delete the user scoped share pref file and store all feature flags in the metadata user DB table

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

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

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.

Copy link
Contributor

github-actions bot commented Nov 16, 2023

Unit Test Results

   438 files     438 suites   30s ⏱️
2 485 tests 2 353 ✔️ 103 💤 29

For more details on these failures, see this check.

Results for commit 567af52.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Nov 16, 2023

Datadog Report

All test runs 5ee7b25 🔗

2 Total Test Services: 2 Failed, 0 with New Flaky, 0 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-jvm 30 0 0 2473 52 6m 23.02s Link
kalium-ios 29 0 0 2353 103 9m 57.16s Link

❌ Failed Tests (59)

This report shows up to 5 failed tests.

  • useCasesShouldNotAccessDaoLayerDirectly[jvm] - com.wire.kalium.logic.architecture.LayerAccessRulesTest - Details

    Expand for error
     com.lemonappdev.konsist.core.exception.KoAssertionFailedException: Assert 'useCasesShouldNotAccessDaoLayerDirectly' was violated (2 times). Invalid files:
     /__w/kalium/kalium/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/ClearUserDataUseCase.kt (ClearUserDataUseCase FileDeclaration)
     /__w/kalium/kalium/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ConversationScope.kt (ConversationScope FileDeclaration)
     
     com.lemonappdev.konsist.core.exception.KoAssertionFailedException: Assert 'useCasesShouldNotAccessDaoLayerDirectly' was violated (2 times). Invalid files:
     /__w/kalium/kalium/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/ClearUserDataUseCase.kt (ClearUserDataUseCase FileDeclaration)
     /__w/kalium/kalium/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ConversationScope.kt (ConversationScope FileDeclaration)
     	at app//com.lemonappdev.konsist.core.verify.KoDeclarationAndProviderAssertCoreKt.getResult(KoDeclarationAndProviderAssertCore.kt:223)
     	at app//com.lemonappdev.konsist.core.verify.KoDeclarationAndProviderAssertCoreKt.assert(KoDeclarationAndProviderAssertCore.kt:51)
     	at app//com.lemonappdev.konsist.api.verify.KoDeclarationAndProviderAssertKt.assertFalse(KoDeclarationAndProviderAssert.kt:103)
     ...
    
  • whenMarkAsNotifiedIsCalledWithLessThen15Minutes_thenSnoozeIsCalledWith5Minutes[jvm] - com.wire.kalium.logic.feature.client.MarkEnablingE2EIAsNotifiedUseCaseTest - Details

    Expand for error
     io.mockative.InvalidExpectationError: A function was called without a matching expectation.
     
         A blocking stub was expected, but a coroutine stub was configured on the function:
             UserConfigRepositoryMock.snoozeE2EINotification(5m)
     
         Set up an expectation using:
             given(instance).coroutine { snoozeE2EINotification(5m) }
                 .then { ... }
         
         The following expectations were configured on the mock:
     ...
    
  • whenMarkAsNotifiedIsCalledWithMoreThen15Minutes_thenSnoozeIsCalledWith15Minutes[jvm] - com.wire.kalium.logic.feature.client.MarkEnablingE2EIAsNotifiedUseCaseTest - Details

    Expand for error
     io.mockative.InvalidExpectationError: A function was called without a matching expectation.
     
         A blocking stub was expected, but a coroutine stub was configured on the function:
             UserConfigRepositoryMock.snoozeE2EINotification(15m)
     
         Set up an expectation using:
             given(instance).coroutine { snoozeE2EINotification(15m) }
                 .then { ... }
         
         The following expectations were configured on the mock:
     ...
    
  • whenMarkAsNotifiedIsCalledWithMoreThen1Day_thenSnoozeIsCalledWith1day[jvm] - com.wire.kalium.logic.feature.client.MarkEnablingE2EIAsNotifiedUseCaseTest - Details

    Expand for error
     io.mockative.InvalidExpectationError: A function was called without a matching expectation.
     
         A blocking stub was expected, but a coroutine stub was configured on the function:
             UserConfigRepositoryMock.snoozeE2EINotification(1d)
     
         Set up an expectation using:
             given(instance).coroutine { snoozeE2EINotification(1d) }
                 .then { ... }
         
         The following expectations were configured on the mock:
     ...
    
  • whenMarkAsNotifiedIsCalledWithMoreThen1Hour_thenSnoozeIsCalledWith1Hour[jvm] - com.wire.kalium.logic.feature.client.MarkEnablingE2EIAsNotifiedUseCaseTest - Details

    Expand for error
     io.mockative.InvalidExpectationError: A function was called without a matching expectation.
     
         A blocking stub was expected, but a coroutine stub was configured on the function:
             UserConfigRepositoryMock.snoozeE2EINotification(1h)
     
         Set up an expectation using:
             given(instance).coroutine { snoozeE2EINotification(1h) }
                 .then { ... }
         
         The following expectations were configured on the mock:
     ...
    

@MohamadJaara MohamadJaara deleted the refactor/remove-user-scoped-shared-pref branch November 25, 2023 23:40
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.

1 participant