Skip to content

fix(dashpay): write identity registration logs to the shareable log files - #1155

Merged
romchornyi merged 1 commit into
developfrom
fix/identity-coordinator-log-export
Oct 2, 2026
Merged

romchornyi merged 1 commit into
developfrom
fix/identity-coordinator-log-export

Conversation

@romchornyi

@romchornyi romchornyi commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

QA tested a TestFlight build on mainnet and reported a DashPay registration that stopped partway. The identity was created on Platform, but its username was never registered. The logs QA exported show nothing from the registration flow. DWIdentityRegistrationCoordinator logs through os.Logger, and the "Share application logs" export only includes the DWLogger files. So those logs never showed which step failed or what the error was, and the cause could not be established.

What was done?

  • The coordinator now logs through DWLogger, the same way SwiftDashSDKHost already does for lines that have to reach the export. DWLogger also still writes to the console, so Xcode and Console.app see the same lines as before. The logger keeps its info / warning / error / debug shape, so call sites stay the same apart from the privacy: .public arguments, which a plain String cannot take. Every argument was already .public, so no field is newly exposed. DWLogger records everything at info level, so warnings and errors carry a WARNING / ERROR tag in the text.
  • The asset-lock status transition line (assetLockStatus → n), which was debug-only before, now reaches the file. It fires only when the status changes, and it is what shows whether the lock reached Consumed.
  • If the username step fails outside the DPNS call itself (a context check, or saving the draft), finishUsernameRegistration now logs the error. Before, it recorded the failure without logging anything.

How Has This Been Tested?

  • xcodebuild -scheme dashpay -sdk iphonesimulator ARCHS=arm64 builds successfully. The build ran locally against a platform checkout three commits behind v4.2-dev. Linking on Xcode 27 needed the local -ld64 → -ld_classic edit from fix(wallet): adopt the UIScene life cycle so the app launches on iOS 27 #1145, which is not part of this PR.
  • The change only redirects where log lines go. Registration behaviour is unchanged.
  • An internal TestFlight build with this change goes back to QA, so the next report of this kind comes with the coordinator's log lines.

Breaking Changes

None.

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

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated diagnostic messages for identity registration and related processes. Registration, recovery, purchase, contest resolution, polling, and funding behavior remain unchanged.

…iles

The registration coordinator logged through os.Logger, which the
"Share application logs" export does not carry. A QA report of an
identity that was created on Platform while its username never was
arrived with no trace of which step failed or why.

Route the coordinator's log lines through DWLogger, which writes the
exported files and still mirrors to the console. The asset-lock status
transitions, previously debug-only, now reach the file too, and a
failure on the username step that happens outside the DPNS call
(context check, draft save) is logged instead of passing silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 62564f57-d3fa-4805-a1b3-a76d6b92ce92

📥 Commits

Reviewing files that changed from the base of the PR and between 30ae177 and 0eeef0f.

📒 Files selected for processing (1)
  • DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The coordinator now uses a private CoordinatorLog adapter that forwards messages to DWLogger. Coordinator log calls no longer specify OSLog privacy levels. The registration and related control flows remain unchanged.

Changes

Coordinator logging

Layer / File(s) Summary
Coordinator logger adapter
DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift
The coordinator logger now uses CoordinatorLog. The adapter forwards debug and info messages to DWLogger and adds WARNING or ERROR prefixes to warning and error messages.
Coordinator log call sites
DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift
Coordinator log calls no longer specify OSLog privacy levels. A username-step failure log was added without changing the surrounding error handling.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: llbartekll

Merge Risk: ⚪ Minimal · up to 0eeef

The logging migration routes coordinator messages to the intended log files. The changed values were already public, and file logging is initialized before registration; no actionable merge risk remains.

Architecture Summary

Architecture risk: 🟡 Medium · up to 0eeef

The change affects 1 system.

Changed systems: DashWallet

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — DashWallet (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift: The OSLog import was removed.
  • observed — Modified behavior in DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift: The coordinator’s private logger changed from OSLog.Logger to CoordinatorLog.
  • observed — Modified behavior in DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift: The create-username and invalid temporary-username pairing log messages no longer annotate interpolated values with os.Logger privacy levels; validation and error handling are unchanged.
  • observed — Modified behavior in DashWallet/Sources/Infrastructure/SwiftDashSDK/Identity/DWIdentityRegistrationCoordinator.swift: The recovery-lock log no longer applies an os.Logger privacy annotation to the status value.

Reliability and maintainability

  • inferred — Risk-relevant change factors for DashWallet: blast_radius_1; blast_radius_2; blast_radius_3; direct_dependents_1
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: writing identity registration logs to shareable log files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit 0eeef0f) · 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

The change correctly routes identity-registration diagnostics through DWLogger into exportable application logs, preserves registration control flow, and adds logging for username-step failures and asset-lock status transitions. No in-scope defects were found; Swift syntax parsing and diff whitespace checks passed. Full build and runtime verification remain unconfirmed: the pinned DashUIKit dependency requires Swift tools 6.3, while the installed Xcode 16.4 provides Swift 6.1.2.

Review provenance

Source: reviewer 1: gemini-3.8-flash-high (agent: phase1-reviewer, role: general); reviewer 2: gpt-6-astra (agent: phase2-reviewer, role: general); final verifier: gpt-6-astra (agent: astra-verifier, role: final-verifier)

  • Triage: low by gpt-6-astra (effort low) — The diff is a contained, single-file logging change that routes coordinator diagnostics to DWLogger and adds a failure log without altering registration, funds movement, or key-handling logic.
  • Phase 1 reviewers: gemini-3.8-flash-high — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: gemini-3.8-flash-high — antigravity quota: weekly 32% left, 5h 85% left
  • Fresh verifier: gpt-6-astra — final-verifier; agent astra-verifier
  • Phase 2 reviewers: gpt-6-astra — general (completed, effort medium); agent phase2-reviewer

@llbartekll llbartekll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. The change does what the description says and nothing else.

What I checked:

  • The premise holds. DiagnosticLogExporter bundles only the SwiftDashSDK sessions and the DWLogger files. It does not read OSLogStore, so before this change the coordinator's os.Logger lines never reached a shared archive.
  • The lines reach the file in TestFlight. ddLogLevel is Info in non-DEBUG builds, so the DDLogInfo behind DWLogger.log passes. CocoaLumberjack logs asynchronously, so routing these calls through it adds no file I/O on the main actor.
  • The migration is complete. No privacy: arguments or OSLog symbols are left. All 53 call sites use one of the adapter's four methods (debug/info/warning/error). Every optional is unwrapped before it is interpolated, so no Optional(...) strings end up in the logs.
  • Exposure is unchanged. Every value was already .public, so the only difference is that it now also goes to the file the user chooses to share.

Non-blocking:

  • The new catch in finishUsernameRegistration also runs for DPNS failures, which registerNames has already logged. A DPNS failure therefore writes two lines, the second showing the error wrapped in dpnsRegistration(...). That is harmless and arguably useful. The description says the catch covers failures "outside the DPNS call", but in practice it fires for every failure.
  • Other parts of this flow still log through os.Logger: AssetLockRecoveryService (6 calls), DWIdentityRegistrationBridge (4), DWCurrentUserIdentityInfo (19) and UsernameMarketplaceService (8). If the next QA export points at one of them, it will need the same change.

I reviewed the code but did not build it locally.

@romchornyi
romchornyi merged commit 1fd8ae3 into develop Oct 2, 2026
4 checks passed
@romchornyi
romchornyi deleted the fix/identity-coordinator-log-export branch October 2, 2026 17:56
romchornyi pushed a commit that referenced this pull request Oct 6, 2026
…me-redesign

Conflicts: the identity coordinator now logs through DWLogger (#1155), so
this branch's os.Logger privacy annotations are dropped and its log lines
kept; the Enable Voting comment takes develop's wording (#1176); the
catalogs keep "Shield your funds first", still used by the funding-privacy
screen, and drop "Shield", which nothing uses any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

4 participants