Skip to content

Conversation

@kidinov
Copy link
Contributor

@kidinov kidinov commented Oct 2, 2025

WOOMOB-1410

Description

Implements persistent flags to support Woo POS survey notifications. This adds infrastructure to track:

  • Whether the POS has been opened at least once
  • Whether survey notifications have been shown to current users
  • Whether survey notifications have been shown to potential users

The implementation includes:

  • wasOpenedOnce flag in WooPosPreferencesRepository using DataStore (global, not site-specific)
  • Survey notification visibility flags in AppPrefs (persist after logout)
  • Integration with WooPosItemsViewModel to automatically set the POS opened flag

Steps to reproduce

Not in use yet

Testing information

  • Unit tests verify flag persistence and default values
  • Tests confirm the POS opened flag is set on ViewModel initialization
  • Survey notification flags are tested for both current and potential users

The tests that have been performed

  • Unit tests

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@kidinov kidinov requested a review from samiuelson October 2, 2025 09:48
@kidinov kidinov modified the milestones: 23.4, 23.5 Oct 2, 2025
@kidinov kidinov marked this pull request as ready for review October 2, 2025 09:48
@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit03bff3e
Direct Downloadwoocommerce-wear-prototype-build-pr14677-03bff3e.apk

@wpmobilebot
Copy link
Collaborator

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commit03bff3e
Direct Downloadwoocommerce-prototype-build-pr14677-03bff3e.apk

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 38.88889% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.41%. Comparing base (098e882) to head (03bff3e).

Files with missing lines Patch % Lines
...opos/util/datastore/WooPosPreferencesRepository.kt 0.00% 7 Missing ⚠️
...rc/main/kotlin/com/woocommerce/android/AppPrefs.kt 42.85% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14677      +/-   ##
============================================
- Coverage     38.41%   38.41%   -0.01%     
+ Complexity     9823     9822       -1     
============================================
  Files          2090     2090              
  Lines        116573   116590      +17     
  Branches      15599    15599              
============================================
+ Hits          44780    44784       +4     
- Misses        67634    67646      +12     
- Partials       4159     4160       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samiuelson samiuelson requested a review from Copilot October 2, 2025 16:17
@samiuelson samiuelson self-assigned this Oct 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements persistent flags to support Woo POS survey notifications. It adds infrastructure to track whether the POS has been opened, and whether survey notifications have been displayed to different user types.

Key changes:

  • Adds wasOpenedOnce flag in WooPosPreferencesRepository using DataStore for global tracking
  • Implements survey notification visibility flags in AppPrefs for current and potential users
  • Integrates POS opened flag tracking in WooPosItemsViewModel initialization

Reviewed Changes

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

Show a summary per file
File Description
WooPosPreferencesRepository.kt Adds DataStore-based wasOpenedOnce flag with getter/setter methods
WooPosItemsViewModel.kt Integrates preferences repository and sets opened flag on initialization
AppPrefs.kt Adds survey notification visibility flags for current and potential users
WooPosItemsViewModelTest.kt Adds test coverage for the opened flag functionality
AppPrefsTest.kt Adds comprehensive test coverage for survey notification flags

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@samiuelson samiuelson left a comment

Choose a reason for hiding this comment

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

LGTM!

@samiuelson samiuelson merged commit 2b8265c into trunk Oct 2, 2025
23 checks passed
@samiuelson samiuelson deleted the woomob-1410-woo-possurveys-implement-persistant-flags branch October 2, 2025 16:19
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.

5 participants