Implement survey wait period (seenSurveyWaitPeriodInDays) for React Native
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 609
- Forks
- 343
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 302
Description
🚨 IMPORTANT
This issue is likely user-facing in the main PostHog app, see surveyVersionRequirements.ts. If you delete or close this issue, be sure to update the version requirements list here.
Summary
The posthog-react-native SDK does not implement the survey wait period (seenSurveyWaitPeriodInDays) filtering logic. The code is commented out in packages/react-native/src/surveys/getActiveMatchingSurveys.ts (lines 47-52).
Current State
- The
seenSurveyWaitPeriodInDaysfield is available on theSurveytype (from@posthog/core) - The filtering logic in
getActiveMatchingSurveys.tshas the wait period check commented out - No
lastSeenSurveyDatestorage is implemented
Expected Behavior
When survey.conditions.seenSurveyWaitPeriodInDays is set, the SDK should:
- Store the date when any survey was last shown to the user
- During
getActiveMatchingSurveys(), skip surveys if the wait period has not yet elapsed since the last seen survey date
Reference Implementation
See posthog-js browser: packages/browser/src/extensions/surveys/surveys-extension-utils.tsx — hasWaitPeriodPassed() function and LAST_SEEN_SURVEY_DATE_KEY storage.
See also: packages/browser/src/extensions/utils/matcher-utils.ts — hasPeriodPassed() utility.
Tracking
This is tracked in the survey SDK feature parity issue: https://github.com/PostHog/posthog/issues/45658
This issue was generated by Claude using the /survey-sdk-audit skill.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read packages/react-native/src/surveys/getActiveMatchingSurveys.ts, especially the commented wait-period logic, then compare it with hasWaitPeriodPassed() and LAST_SEEN_SURVEY_DATE_KEY in packages/browser/src/extensions/surveys/surveys-extension-utils.tsx and hasPeriodPassed() in packages/browser/src/extensions/utils/matcher-utils.ts. Done means React Native persists the date any survey was shown and getActiveMatchingSurveys() skips surveys until the configured wait period has elapsed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100