Skip to content

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

Open
Elouan1411 wants to merge 1 commit 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 1 commit 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.

Comment on lines 27 to 31
open fun init(
countdownBehavior: Behavior = Behavior.LifecycleBased,
appReviewThreshold: Int? = null,
maxAppReviewThreshold: Int? = null,
onUserWantToReview: (() -> Unit)? = null,
onUserWantToGiveFeedback: (() -> Unit)? = null
@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 from 11abef0 to cff4c1a Compare June 1, 2026 11:58
@Elouan1411
Elouan1411 force-pushed the rating-pop-up-dont-ask branch from cff4c1a to dd10b16 Compare June 1, 2026 12:03
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown


val APP_REVIEW_THRESHOLD_KEY = intPreferencesKey("appReviewThresholdKey")
val ALREADY_GAVE_REVIEW_KEY = booleanPreferencesKey("alreadyGaveReview")
val ALREADY_ASK_REVIEW_KEY = booleanPreferencesKey("alreadyGaveReview")

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.

If you rename the constant, you should rename the key.

override fun onUserWantsToDismiss() {
resetAppReviewSettings()
}
override fun onUserWantsToDismiss() = Unit

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.

Why keeping this if it is Unit ?

private fun <T> getInitialValue(key: Preferences.Key<T>) = when (key) {
APP_REVIEW_THRESHOLD_KEY -> appReviewThreshold
ALREADY_GAVE_REVIEW_KEY -> DEFAULT_ALREADY_GAVE_REVIEW
ALREADY_ASK_REVIEW_KEY -> DEFAULT_ALREADY_GAVE_REVIEW

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.

The default has also the wrong name.

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