Skip to content

feat: Do not display the review pop-up again if the user clicks no - #752

Open
Elouan1411 wants to merge 4 commits into
mainfrom
rating-pop-up-dont-ask
Open

feat: Do not display the review pop-up again if the user clicks no#752
Elouan1411 wants to merge 4 commits into
mainfrom
rating-pop-up-dont-ask

Conversation

@Elouan1411

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 21, 2026 13:17
@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from e6a47f9 to acf6c03 Compare April 21, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a persistent “do not show again” flag to the in-app review gating logic so that once a user declines (via the negative/feedback path), the review prompt won’t be shown in future sessions.

Changes:

  • Introduce a new DataStore preference key (DO_NOT_SHOW_AGAIN_KEY) with a default value.
  • Update shouldDisplayReviewDialog to also depend on the new “do not show again” flag.
  • Persist the “do not show again” flag when the user chooses the feedback/negative action.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
InAppReview/src/standard/kotlin/com/infomaniak/core/inappreview/reviewmanagers/InAppReviewManager.kt Includes the new flag in the dialog display conditions and writes the flag when the user selects the negative/feedback path.
InAppReview/src/main/kotlin/com/infomaniak/core/inappreview/AppReviewSettingsRepository.kt Adds the new DataStore key and default initial value wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Apr 21, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 8ec8440)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Race Condition

In onUserWantsToGiveFeedback, both resetAppReviewSettings() and disableReviewDialog() launch separate coroutines on Dispatchers.IO without synchronization. If resetAppReviewSettings() executes after disableReviewDialog(), it may overwrite the DO_NOT_SHOW_AGAIN_KEY value back to false, causing the review dialog to appear again despite the user having already chosen to give feedback. These operations should be combined into a single atomic transaction or properly sequenced to ensure the "do not show again" flag persists.

override fun onUserWantsToGiveFeedback(feedbackUrl: String) {
    onUserWantsToGiveFeedback?.invoke()
    resetAppReviewSettings()
    WebViewActivity.startActivity(activity, feedbackUrl)
    disableReviewDialog()

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 5225da1

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from 5225da1 to acf6c03 Compare April 21, 2026 13:39
@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from acf6c03 to e3c8fbb Compare April 21, 2026 14:13
@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch 2 times, most recently from e658c64 to 8ec8440 Compare April 21, 2026 14:45
@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit 8ec8440

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from 8ec8440 to 2ca15f9 Compare April 22, 2026 07:47
@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from 2ca15f9 to 9acb957 Compare April 24, 2026 13:58
@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from 9acb957 to b24e902 Compare April 27, 2026 09:49

@FabianDevel FabianDevel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't add a new preference.
The logic now is that either way if you click on one or the other button, the popup should not come back.
So you can use a single preference for both

The best should be that you don't do anything by default, and just move the logic of the threshold on the onDismiss action

@FabianDevel
FabianDevel force-pushed the rating-pop-up-dont-ask branch from b24e902 to c8199eb Compare May 21, 2026 12:59
@sonarqubecloud

Copy link
Copy Markdown

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch 2 times, most recently from 3c5aace to 5943ce0 Compare May 28, 2026 15:36
@Elouan1411
Elouan1411 requested a review from Copilot May 28, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from 5943ce0 to 11abef0 Compare May 28, 2026 16:03
@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch 2 times, most recently from cff4c1a to dd10b16 Compare June 1, 2026 12:03
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from dd10b16 to 23eb461 Compare August 7, 2026 09:22
@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from 30123d1 to 2d6bc34 Compare August 7, 2026 09:39
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (4)

InAppReview/src/main/kotlin/com/infomaniak/core/inappreview/BaseInAppReviewManager.kt:31

  • Removing this parameter changes the public init method descriptor, so existing consumers can fail to compile (named argument) or at runtime (NoSuchMethodError) even when they did not explicitly set it. Preserve a deprecated compatibility overload/parameter while transitioning consumers; the implementation may ignore it under the new one-shot behavior.
    open fun init(
        countdownBehavior: Behavior = Behavior.LifecycleBased,
        appReviewThreshold: Int? = null,
        onUserWantToReview: (() -> Unit)? = null,
        onUserWantToGiveFeedback: (() -> Unit)? = null

InAppReview/src/standard/kotlin/com/infomaniak/core/inappreview/reviewmanagers/InAppReviewManager.kt:89

  • setAppReviewedStatus now records that the dialog was shown, not that the app was reviewed. Rename it to match the persisted state and avoid callers treating this as proof that a review occurred.
    override fun onReviewDialogShown() {
        setAppReviewedStatus()

InAppReview/README.md:79

  • This example marks the prompt as asked while rendering under if (shouldDisplay). The DataStore update then makes the flow emit false, recomposes this branch away, and dismisses the dialog before the user can choose an action. Keep dialog visibility in separate remembered state and perform the persistence call as a side effect.
    if (shouldDisplay) {
        reviewManager.onReviewDialogShown()
        ReviewDialog(

InAppReview/src/standard/kotlin/com/infomaniak/core/inappreview/reviewmanagers/InAppReviewManager.kt:47

  • These names still mix the old “gave review” meaning with the new “was asked” state, and alreadyAskReview is not a clear boolean name. Rename the flow and lambda parameter consistently so future changes do not mistake displaying the prompt for submitting a review.

This issue also appears on line 88 of the same file.

    override val shouldDisplayReviewDialog =
        combine(alreadyAskReview, appReviewCountdown) { alreadyGaveReview, countdown ->
            !alreadyGaveReview && countdown <= 0

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.

4 participants