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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: single use survey not working with email verification #1935

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

Dhruwang
Copy link
Contributor

What does this PR do?

Fixes 1685
Also currently single use surveys are broken in general (can fill them multiple times) and its due to a cached service getResponseBySIngleUseId , right now I have removed caching from that service as it is been used at one place only where we dont really require the cached response

How should this be tested?

Take a single use survey with email verification

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 馃檹

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented Jan 22, 2024

The latest updates on your projects. Learn more about Vercel for Git 鈫楋笌

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-cloud 猬滐笍 Ignored (Inspect) Visit Preview Jan 26, 2024 4:14pm
formbricks-com 猬滐笍 Ignored (Inspect) Visit Preview Jan 26, 2024 4:14pm

Copy link
Contributor

github-actions bot commented Jan 22, 2024

Thank you for following the naming conventions for pull request titles! 馃檹

Copy link
Member

@mattinannt mattinannt left a comment

Choose a reason for hiding this comment

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

@Dhruwang thanks for fixing the single use surveys together with email validation 馃槉馃敟 Works great! 馃槉
But I wasn't really satisfied with removing the cache from the service 馃槈 The cache itself wasn't the problem and it's good it's there; the issue was that the cache wasn't revalidated correctly. So even a response for the singleUseId for this survey came in, the old cache was used. This could be solved by checking the revalidation strategy of the cache in the specific event (e.g. createResponse).
I re-added the cache and fixed the revalidation in the createResponse 馃槉

@mattinannt mattinannt added this pull request to the merge queue Jan 26, 2024
Merged via the queue into main with commit 6dcd065 Jan 26, 2024
13 checks passed
@mattinannt mattinannt deleted the email-verify-issue branch January 26, 2024 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants