Remove the duplicate sandbox cookie injection in `SiteCreationPurchasingWebFlowController`
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- ios, swift
- Domain
- mobile, mobile-dev
Research direction
Open SiteCreationPurchasingWebFlowController.swift around the linked injectSandboxStoreCookie method and the call site that already holds a WebKitViewController. Replace that private method with webViewController.configureSandboxStore from WebKitViewController+SandboxStore.swift, then delete the unused Constants cookie name/domain. Confirm the only caller still compiles with the discarded completion Bool. Unifying the cookie literals across the three files is optional follow-on work, not required to close this issue.
Written by the indexing model from the issue text.
Description
Found while reviewing #26103.
SiteCreationPurchasingWebFlowController.injectSandboxStoreCookie(into:completion:) is a duplicate of WebKitViewController.configureSandboxStore(_:).
Details
As of #26103 both methods do the same thing: find the store_sandbox cookie for .wordpress.com in HTTPCookieStorage.shared, then call setCookie on the web view's WKHTTPCookieStore. #26103 had to apply the same edit to both copies.
- The only difference is the
Boolpassed to the completion, and the only caller discards it ({ [weak self] _ in). webViewControllerat that call site is already aWebKitViewController— the return type ofWebViewControllerFactory.controllerWithDefaultAccountAndSecureInteraction— soconfigureSandboxStoreis available on it.- The cookie name and domain literals are defined in three files:
StoreSandboxSecretScreen.swift,SiteCreationPurchasingWebFlowController.swift(Constants) andWebKitViewController+SandboxStore.swift.
Suggested fix
Replace the private method with webViewController.configureSandboxStore { … } and delete the two Constants. Moving the cookie name and domain to a single definition is a natural follow-on, but separate.
- Dominant language
- Swift
- Stars
- 3.9k
- Forks
- 1.2k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 56
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wordpress-mobile/WordPress-iOS
-
[Type] Bug Self-hosted Webviews
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
wordpress-mobile/WordPress-iOS#26115 ·
Maintainers usually reply within 1 day
-
[Type] Tech Debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wordpress-mobile/WordPress-iOS#26112 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wordpress-mobile/WordPress-iOS#25657 · 1 comment ·
Maintainers usually reply within 1 day
-
Rename Stats Insight cards for clarityPossibly taken @amitraj2203 claimed this 56 days ago. Open[Pri] Low [Type] Enhancement Stats
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wordpress-mobile/WordPress-iOS#23015 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Remove Google Plus mentionsPossibly taken @raagad claimed this 170 days ago. Open[Type] Tech Debt Good First Issue Sharing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wordpress-mobile/WordPress-iOS#20142 · 15 comments ·
Maintainers usually reply within 1 day
All issues in wordpress-mobile/WordPress-iOS
Similar issues
-
Native HTTP policy fixture rejects its pathless response URLPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Notion AI: getSpaces response exceeds 5 MB plugin limit for multi-workspace accountsPossibly taken A pull request linked to this issue is open or already merged. Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
steipete/CodexBar#4341 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
kiosk_set_screensaver_mode ignored: mode is not passed through by the notification parserPossibly taken @bgoncal claimed this today. Openbug ios
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
home-assistant/iOS#6001 ·
Maintainers usually reply within 1 day
-
area: docs area: ios S3: minor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
manaflow-ai/cmux#18416 · 1 comment ·
Maintainers usually reply within 1 day