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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Enable grecaptcha.render optional callback. #79

Merged
merged 3 commits into from
Oct 24, 2019

Conversation

yatatsu
Copy link
Contributor

@yatatsu yatatsu commented Oct 8, 2019

I'd like to introduce following optional callbacks of grecaptcha.render.

  • expired-callback
  • error-callback

cf. https://developers.google.com/recaptcha/docs/invisible

Currently, when the connectivity is lost after starting recaptcha sequence, there is no way to know the hanging.
error-callback is called when a connectivity issue happens, and the result should be error.

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #79 into master will decrease coverage by 0.09%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #79     +/-   ##
=========================================
- Coverage   96.39%   96.29%   -0.1%     
=========================================
  Files           8        8             
  Lines         305      324     +19     
=========================================
+ Hits          294      312     +18     
- Misses         11       12      +1
Impacted Files Coverage Δ
ReCaptcha/Classes/ReCaptchaDecoder.swift 97.87% <100%> (+0.81%) ⬆️
ReCaptcha/Classes/ReCaptchaError.swift 80% <83.33%> (+0.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d9f27f...237301a. Read the comment docs.

// 'expired-callback': () => {
// post({ error: 28 });
// clearObservers();
// },
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this commented out? It looks like the code will never catch "expired response" errors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review! I did debug with commented out this, and I forgot to fix it. I didn't mean to comment out, so I will fix it.

@fjcaetano
Copy link
Owner

Good stuff. I only have one question I commented above. Once that has been cleared, it's good to be merged

@fjcaetano fjcaetano merged commit 237301a into fjcaetano:master Oct 24, 2019
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.

None yet

2 participants