Skip to content

Bugfix/network issues on init - #213

Open
CAMOBAP wants to merge 11 commits into
masterfrom
bugfix/network-issues-on-init
Open

Bugfix/network issues on init#213
CAMOBAP wants to merge 11 commits into
masterfrom
bugfix/network-issues-on-init

Conversation

@CAMOBAP

@CAMOBAP CAMOBAP commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

@CAMOBAP CAMOBAP self-assigned this Mar 20, 2026
@CAMOBAP
CAMOBAP force-pushed the bugfix/network-issues-on-init branch from b10849d to c9943c5 Compare March 20, 2026 22:32
@github-actions

github-actions Bot commented Mar 20, 2026

Copy link
Copy Markdown

Cocoapods size report:

OLD: 146409 bytes
NEW: 163416 bytes

DIFF: 17007 bytes

@CAMOBAP
CAMOBAP force-pushed the bugfix/network-issues-on-init branch from f7ace79 to ab8cdef Compare March 21, 2026 20:37
@CAMOBAP
CAMOBAP requested a review from e271828- March 21, 2026 20:48
@CAMOBAP
CAMOBAP marked this pull request as ready for review March 21, 2026 20:48
@CAMOBAP CAMOBAP mentioned this pull request Mar 21, 2026
Comment thread HCaptcha/Assets/hcaptcha.html
CAMOBAP added 9 commits March 26, 2026 11:23
…t interference

- Clear WKWebsiteDataStore and DispatchQueue.onceTokenStorage between tests
- Remove leftover WKWebView subviews in tearDown across all test classes
- Replace fragile fixed-delay assertions with XCTNSPredicateExpectation
- Fix Rx test__Reset to avoid toBlocking() dispose poisoning manager state
- Re-enable HCaptchaWebViewManager__HTML__Tests and HCaptcha_Rx__Tests
- Move test-only throttle/debounce/resetOnceTokens out of production code
- Rename DispatchQueue+Throttle.swift to DispatchQueue+Once.swift
- Reduce test timeouts (CI: 30s/60s/10s, local: 5s/15s/2s)
Record loadingState as .failed even when completion is present, so
subsequent validate() calls can detect the failure and reload HTML.
Switch mock.html from sessionStorage to document.cookie for loadCount
tracking, since sessionStorage resets on each loadHTMLString call.
Use .nonPersistent() data store so the SDK leaves no cookies,
localStorage, or cache on the device. Switch mock.html to
localStorage for loadCount.
@CAMOBAP
CAMOBAP force-pushed the bugfix/network-issues-on-init branch from 75c7f98 to 9de016e Compare March 26, 2026 11:01
@CAMOBAP
CAMOBAP requested a review from e271828- March 26, 2026 12:16
CAMOBAP added 2 commits March 26, 2026 18:36
P1 - Prevent double execute() on didFinishLoading: capture pending
completion state before setting loadingState = .loaded so the didSet
callback (onDidFinishLoading) cannot trigger a second execute via
validate().

P1 - Always transition to .failed on error: handle(error:) now sets
loadingState = .failed unconditionally before completing, so a
terminated web view is never left in .loaded state where subsequent
validate() calls would try JS on a dead process.

P2 - Classify navigation errors instead of blanket .networkError:
introduce classify(navigationError:) that maps known NSURLErrorDomain
connectivity codes to .networkError (eligible for retry) and preserves
the original NSError as .unexpected for cancellations and non-network
failures, restoring diagnosability.
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.

2 participants