Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

remix-utils/honeypot is not working anymore #770

Closed
davidesigner opened this issue Sep 15, 2024 · 5 comments
Closed

remix-utils/honeypot is not working anymore #770

davidesigner opened this issue Sep 15, 2024 · 5 comments

Comments

@davidesigner
Copy link

davidesigner commented Sep 15, 2024

Describe the bug and the expected behavior

When you use the Honeypot from remix-utils (as explain in the documentation: with HoneypotProvider and HoneypotInputs), sometimes, the input from__confirm value is missing in the formData (while I see a value in the Provider if I add a console.log). Sometimes, it's working well... In e2e tests, the problem is always here on my side.

Maybe it's because there's no more key added to the input in the last version?

N.B. no problem in v1.1.5.

Conform version

v1.2.1

Steps to Reproduce the Bug or Issue

  1. Install the epic stack starter project: https://github.com/epicweb-dev/epic-stack
  2. Update conform to v1.2.1.
  3. Run e2e tests → broken.

What browsers are you seeing the problem on?

Chrome, Others

Screenshots or Videos

Screenshot 2024-09-15 at 19 38 09
  • l.204 is clicking on the submit button;
  • l.205 check if the next step is displayed (KO). → because of HoneypotInputs missing value.

Additional context

Do you have a solution to this problem? Ideally, I don't want to have to set defaultValue for every form that contains <HoneypotInputs />.

@edmundhung
Copy link
Owner

Thanks for the report. I wish I realize this earlier. This is definitely not an uncommon case so we will need to address this as soon as possible.

A few solutions I have in mind right now:

  1. Add an option to opt out from been managed by conform

This is becoming a breaking change and I hate it.

  1. Add a data attribute to opt-in instead

This can be set with the getInputProps so it won't be a breaking change. But I hate it too because it means the minimal setup is not minimal anymore.

  1. Automatic opt-in based on the initial value

Conform will only opt in for auto value update if the initial value matches the settings in the useForm hook. This should solve the issue you had but it adds an assumption that the initial value is always set to something on render. If there are any asynchronous works involved and the input has no initial value at first, conform will opt it in since it consider the initial values matches.😬

@edmundhung
Copy link
Owner

edmundhung commented Sep 17, 2024

I have put up a fix on #775. Can you give the pre-release a try and let me know if you run into any issues? Thanks.

@mxp-qk
Copy link

mxp-qk commented Sep 18, 2024

I add the same issue with CSRF token (via remix-utils) being removed since 1.2.0, I tried with the #775 and it works again for me

@edmundhung
Copy link
Owner

I'm sorry for the trouble. I've concluded that it's best to revert the relevant changes, and I've just published v1.2.2.

@davidesigner
Copy link
Author

@edmundhung, 1.2.2 fixed this problem but we should maybe reopen these issues?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants