Skip to content

refactor(dashconnect): drop the hardcoded app brand map - #1323

Closed
romchornyi wants to merge 1 commit into
developfrom
feat/dashconnect-no-app-brand-map
Closed

romchornyi wants to merge 1 commit into
developfrom
feat/dashconnect-no-app-brand-map

Conversation

@romchornyi

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

The wallet carried a brand map with one entry: Yappr's mainnet contract id → "Yappr", yap.pr (#909). It made one app special: its one-QR and v1 requests were named "Yappr" whatever their label said, and its App Connect v2 requests (#1210) got a different warning on the approve sheet from every other app. Android keeps no such map. The wallet should not decide which apps it knows by a list in its own code.

What was done?

  • DashConnectFallbackAppMetadata keeps no list: an app is named by its request's label until Platform gives the contract owner's username (as before for every app but Yappr), and has no website.
  • App Connect v2: GrantPlan.brandHost, AppConnect.OriginWarning, originWarning and isHost are gone. The approve sheet always shows "This wallet does not know this app, so it cannot confirm the name shown or where the request came from.", which is what it already showed for every app except Yappr's mainnet contract. "Only approve if you just started signing in on %@." names the callback host, or the app's name when there is none.
  • The two strings only a known app could get ("This request does not return to %@…", "This request would return to %@…") are removed from all 43 catalogs with bartycrouch update: 258 lines out, nothing else changed.
  • The mock data source keeps its "Login to Yappr" sample: it is preview data, not branding.

How Has This Been Tested?

  • DashWalletTests DashConnect classes (AppConnectV2LoginTests, DashConnectDataSourceTests, DashConnectStoreTests, DashConnectUriTests, KeyExchangeCryptoTests, LoginKeyDerivationTests, PlatformDashConnectDataSourceTests, Secp256k1Tests) on an iPhone simulator: 195 tests, 0 failures.
  • testBrandingResolvesKnownContractRegardlessOfLabel becomes testNoContractHasBrandingOfItsOwn: Yappr's mainnet contract is named by the label and has no website. The test of the removed origin warnings is removed with them.
  • The Maestro scenario for feat(dashpay): sign in with App Connect request v2 #1210 (dashconnect_v2_approve_sheet_deny) already runs against Yappr's testnet contract, which was never in the map, so its sheet is the one every app now gets.
  • scripts/a11y_audit.py --check: no new findings.

Breaking Changes

None. Stored connections keep their names; only a newly resolved Yappr request is named by its label or owner's username instead of "Yappr".

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • ADR (ADR-0001), keep the answer that applies: no significant decision
  • Nothing in this PR (files, commit messages, branch name, description, comments, attachments, linked issues) holds customer data, unfixed vulnerability detail, secrets, or step-by-step attack detail against keys, PIN or encryption; such content is left out and handled privately with the maintainers (ADR-0001, rule 2)

🤖 Generated with Claude Code

The wallet named one app itself: Yappr's mainnet contract id mapped to
"Yappr" and yap.pr. Every other app was named by its request's label or
its contract owner's username, and the v2 approve sheet warned only for
those. Android keeps no such map.

Now no app is special:
- a one-QR or v1 request is named by its label until Platform gives the
  contract owner's username, and has no website;
- the v2 sheet always says the wallet cannot confirm the app's name or
  where the request came from, and "Only approve if you just started
  signing in on" names the callback host or the app's name;
- the two warnings only a known app could get ("does not return to",
  "would return to") are gone, with their strings in all 43 catalogs
  (bartycrouch update).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 243ccb65-131c-4405-962c-95b9894f0ecc
Commits

Reviewing files that changed from the base of the PR and between 7defb24 and 6a5a428.

Files selected for processing: 50

  • DashWallet/Sources/Models/DashConnect/AppConnectV2Login.swift
  • DashWallet/Sources/Models/DashConnect/DashConnectModels.swift
  • DashWallet/Sources/Models/DashConnect/PlatformDashConnectDataSource.swift
  • DashWallet/Sources/UI/DashConnect/ApproveConnectionSheet.swift
  • DashWallet/Sources/UI/DashConnect/ConnectionsViewModel.swift
  • DashWallet/ar.lproj/Localizable.strings
  • DashWallet/bg.lproj/Localizable.strings
  • DashWallet/ca.lproj/Localizable.strings
  • DashWallet/cs.lproj/Localizable.strings
  • DashWallet/da.lproj/Localizable.strings
  • DashWallet/de.lproj/Localizable.strings
  • DashWallet/el.lproj/Localizable.strings
  • DashWallet/en.lproj/Localizable.strings
  • DashWallet/eo.lproj/Localizable.strings
  • DashWallet/es.lproj/Localizable.strings
  • DashWallet/et.lproj/Localizable.strings
  • DashWallet/fa.lproj/Localizable.strings
  • DashWallet/fi.lproj/Localizable.strings
  • DashWallet/fil.lproj/Localizable.strings
  • DashWallet/fr.lproj/Localizable.strings
  • DashWallet/hr.lproj/Localizable.strings
  • DashWallet/hu.lproj/Localizable.strings
  • DashWallet/id.lproj/Localizable.strings
  • DashWallet/it.lproj/Localizable.strings
  • DashWallet/ja.lproj/Localizable.strings
  • DashWallet/ko.lproj/Localizable.strings
  • DashWallet/mk.lproj/Localizable.strings
  • DashWallet/ms.lproj/Localizable.strings
  • DashWallet/nb.lproj/Localizable.strings
  • DashWallet/nl.lproj/Localizable.strings
  • DashWallet/pl.lproj/Localizable.strings
  • DashWallet/pt.lproj/Localizable.strings
  • DashWallet/ro.lproj/Localizable.strings
  • DashWallet/ru.lproj/Localizable.strings
  • DashWallet/sk.lproj/Localizable.strings
  • DashWallet/sl.lproj/Localizable.strings
  • DashWallet/sl_SI.lproj/Localizable.strings
  • DashWallet/sq.lproj/Localizable.strings
  • DashWallet/sr.lproj/Localizable.strings
  • DashWallet/sv.lproj/Localizable.strings
  • DashWallet/th.lproj/Localizable.strings
  • DashWallet/tr.lproj/Localizable.strings
  • DashWallet/uk.lproj/Localizable.strings
  • DashWallet/vi.lproj/Localizable.strings
  • DashWallet/zh-Hans.lproj/Localizable.strings
  • DashWallet/zh-Hant-TW.lproj/Localizable.strings
  • DashWallet/zh.lproj/Localizable.strings
  • DashWallet/zh_TW.lproj/Localizable.strings
  • DashWalletTests/DashConnect/AppConnectV2LoginTests.swift
  • DashWalletTests/DashConnect/DashConnectDataSourceTests.swift
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

thepastaclaw commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 6a5a428) · triage: low

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Final validation — Phase 1 + Phase 2

At head 6a5a428, the brand-map removal is consistent across metadata resolution and the approval sheet; no blocking behavioral or security defects were confirmed. Two non-blocking items remain: comments describing the removed branding mechanism and a PR-title scope rejected by the configured workflow. Validation was static only; current CI shows simulator tests, test-target membership, and accessibility checks passing, with PR-title validation failing.

🟡 2 suggestion(s)

2 finding(s) not shown inline (the lines are not part of this PR's diff)

🟡 Suggestion: Update comments that still describe contract-specific branding
DashWalletTests/DashConnect/DashConnectDataSourceTests.swift:228-229

This comment and the MARK at line 208 still say branding follows the contract id, but this PR removes that mechanism: ConnectionRequest now uses the supplied label and an empty website for every contract. The same drift appears in DashWallet/Sources/Models/DashConnect/DashConnectDataSource.swift:125–126, where the mock claims its contract resolves to Yappr branding even though sampleRequest now displays "Login to Yappr" with no website. Update these comments together to describe the label-only fallback. This is directly affected documentation, not unrelated cleanup, and leaving it contradicts the project's guardrail that comments describe implemented behavior.

    /// A QR may claim any label it likes. The fallback displays that label
    /// as given and assigns no website, regardless of the contract id.

source: glm-5.3-flash (phase1-reviewer: general)

🟡 Suggestion: Use an allowed scope in the PR title
.github/workflows/semantic-pull-request.yml:42-54

The current title, "refactor(dashconnect): drop the hardcoded app brand map", uses a scope absent from this workflow's allowed list. The failed log for run 42613256712 explicitly reports Unknown scope "dashconnect", and the current PR check still fails for that reason. Retitle the PR to use an existing scope, such as "refactor(dashpay): drop the hardcoded app brand map". No workflow change is needed unless maintainers explicitly want to introduce a new allowed scope.

source: glm-5.3-flash (phase1-reviewer: general)

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — The change is a small, contained removal of hardcoded branding and conditional approval warnings, with mechanical localization cleanup and no changes to signing, key handling, or request acceptance.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 98% left, weekly 100% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort medium); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `DashWalletTests/DashConnect/DashConnectDataSourceTests.swift`:
- [SUGGESTION] DashWalletTests/DashConnect/DashConnectDataSourceTests.swift:228-229: Update comments that still describe contract-specific branding
  This comment and the MARK at line 208 still say branding follows the contract id, but this PR removes that mechanism: ConnectionRequest now uses the supplied label and an empty website for every contract. The same drift appears in DashWallet/Sources/Models/DashConnect/DashConnectDataSource.swift:125–126, where the mock claims its contract resolves to Yappr branding even though sampleRequest now displays "Login to Yappr" with no website. Update these comments together to describe the label-only fallback. This is directly affected documentation, not unrelated cleanup, and leaving it contradicts the project's guardrail that comments describe implemented behavior.

In `.github/workflows/semantic-pull-request.yml`:
- [SUGGESTION] .github/workflows/semantic-pull-request.yml:42-54: Use an allowed scope in the PR title
  The current title, "refactor(dashconnect): drop the hardcoded app brand map", uses a scope absent from this workflow's allowed list. The failed log for run 42613256712 explicitly reports `Unknown scope "dashconnect"`, and the current PR check still fails for that reason. Retitle the PR to use an existing scope, such as "refactor(dashpay): drop the hardcoded app brand map". No workflow change is needed unless maintainers explicitly want to introduce a new allowed scope.

@romchornyi

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #1278: its approve-sheet redesign removes the same brand map (knownApps, brandHost, originWarning), so landing this one as well would only add a conflict on the same lines.

The bot's suggestion about comments that still describe contract-based branding is carried over to #1278 (the sample request comment in DashConnectDataSource.swift). The title-scope suggestion no longer applies.

@romchornyi romchornyi closed this Nov 15, 2026
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