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

[NT-1599] Survey Response Bugfix #1346

Merged
merged 1 commit into from
Dec 4, 2020
Merged

Conversation

justinswart
Copy link
Contributor

📲 What

Fixes a bug in SurveyResponseViewModel which was causing survey response submission to fail on iOS 14.

🤔 Why

In the time of iOS 12 and iOS 13, a bug existed in WKWebView which would produce a nil httpBody property on URLRequest. This was problematic for us because we would intercept these requests in order to inject our authentication headers before submitting the form data in the web view. A workaround was introduced in #975 to do this which thus expected the httpBody to be nil however it no longer is on iOS 14 as it seems Apple or the WebKit team have fixed this bug (although I can't find a source to confirm this).

🛠 How

Added another path to handle the request which does not require the httpBody to be nil and in this case does not evaluate the JavaScript as a workaround.

👀 See

Some discussion of the original WKWebView bug:

https://bugs.webkit.org/show_bug.cgi?id=145410
https://bugs.webkit.org/show_bug.cgi?id=167131

✅ Acceptance criteria

  • Navigate to a survey on iOS 13, submission should be successful.
  • Navigate to a survey on iOS 14, submission should be successful.

Copy link
Contributor

@singhhari singhhari left a comment

Choose a reason for hiding this comment

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

lgtm!

@codecov
Copy link

codecov bot commented Dec 4, 2020

Codecov Report

Merging #1346 (9199cc5) into master (c5277e1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1346   +/-   ##
=======================================
  Coverage   85.97%   85.98%           
=======================================
  Files        1098     1098           
  Lines       97775    97839   +64     
=======================================
+ Hits        84058    84122   +64     
  Misses      13717    13717           
Impacted Files Coverage Δ
Library/ViewModels/SurveyResponseViewModel.swift 100.00% <100.00%> (ø)
...rary/ViewModels/SurveyResponseViewModelTests.swift 100.00% <100.00%> (ø)

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 c5277e1...9199cc5. Read the comment docs.

@justinswart justinswart merged commit 448cff4 into master Dec 4, 2020
@justinswart justinswart deleted the NT-1599-survey-response-bugfix branch December 4, 2020 21:02
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.

2 participants