Skip to content

Fix delegating bug#3138

Merged
feruzm merged 2 commits intodevelopmentfrom
delg
Mar 6, 2026
Merged

Fix delegating bug#3138
feruzm merged 2 commits intodevelopmentfrom
delg

Conversation

@feruzm
Copy link
Member

@feruzm feruzm commented Mar 6, 2026

Summary by CodeRabbit

  • Improvements
    • Auth upgrade dialog now supports gesture navigation and backdrop dismissal for smoother interactions.
    • More reliable auth upgrade prompts: concurrent requests are serialized to avoid duplicate dialogs.
    • More robust upgrade dialog behavior to ensure it opens reliably even when prior identifiers are missing.
    • Standardized transfer flow: delegate transfers now use a consistent transfer type and asset layer across the app.

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9aa675a4-6020-4d79-a447-1f508465a5c0

📥 Commits

Reviewing files that changed from the base of the PR and between 49a5452 and b386642.

📒 Files selected for processing (1)
  • src/providers/sdk/mobilePlatformAdapter.ts

📝 Walkthrough

Walkthrough

Consolidates transfer-type usage to centralized constants, adds an in-flight cache to serialize concurrent auth-upgrade prompts, and makes the auth-upgrade sheet resilient to missing sheetId by using a fallback ID and enabling gesture/backdrop interactions.

Changes

Cohort / File(s) Summary
Auth Upgrade Sheet
src/components/authUpgradeSheet/authUpgradeSheet.tsx
Added internal FALLBACK_SHEET_ID and used it when rendering/hiding the sheet; added local state (keyInput, error, isValidating) with a useEffect reset on payload changes; enabled gestureEnabled and closeOnTouchBackdrop by default.
Request Serialization (Auth Upgrade)
src/providers/sdk/mobilePlatformAdapter.ts
Added _pendingAuthUpgradePromise to serialize concurrent showAuthUpgradeUI calls; function now reuses an in-flight promise, creates one when absent, and clears it in finally. Return type adjusted to remove one option.
Transfer Type Consolidation
src/containers/profileContainer.tsx, src/screens/assetDetails/children/delegationsModal.tsx, src/screens/referScreen/referScreen.tsx
Replaced literal 'delegate' with TransferTypes.DELEGATE_VESTING_SHARES and added assetLayer: TokenLayers.HIVE to transfer navigation params across three files.
Manifest
package.json
Small dependency/manifest lines changed (+6/-4).

Sequence Diagram

sequenceDiagram
    participant Client as Client
    participant Platform as mobilePlatformAdapter
    participant Cache as In-Flight Cache
    participant Sheet as ActionSheet

    Client->>Platform: showAuthUpgradeUI(requiredAuthority, operation)
    alt pending promise exists
        Platform->>Cache: return existing promise
        Cache-->>Client: promise resolves (choice or false)
    else no pending promise
        Platform->>Cache: create _pendingAuthUpgradePromise
        Platform->>Sheet: load sheet dependencies
        Sheet-->>Platform: dependencies loaded
        Platform->>Sheet: show AUTH_UPGRADE sheet (id = sheetId || FALLBACK_SHEET_ID)
        Sheet-->>Platform: user selection or dismiss
        Platform->>Cache: resolve promise with result
        Platform->>Cache: clear _pendingAuthUpgradePromise (finally)
        Cache-->>Client: promise resolves (choice or false)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

deploy-pr-build

Poem

🐰 A little hop, a fallback found,
Promises lined up, no more collisions around,
Delegates wear constants, layers set to Hive,
Sheets now listen to gestures, the UI's alive,
I nibble code and watch the flows thrive.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fix delegating bug' is vague and does not clearly describe the specific changes made in the pull request. Consider a more descriptive title that specifies what delegating bug is being fixed, such as 'Fix delegation transfer type and asset layer parameters' or 'Standardize delegation transfer types and add asset layer support'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch delg

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 and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm merged commit 7c11e3e into development Mar 6, 2026
0 of 3 checks passed
@feruzm feruzm deleted the delg branch March 6, 2026 18:40
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.

1 participant