Skip to content

refactor(deposit): copy provider order id#17026

Merged
wachunei merged 2 commits into
mainfrom
refactor/deposit-copy-order-id
Jul 9, 2025
Merged

refactor(deposit): copy provider order id#17026
wachunei merged 2 commits into
mainfrom
refactor/deposit-copy-order-id

Conversation

@wachunei

@wachunei wachunei commented Jul 9, 2025

Copy link
Copy Markdown
Member

Description

This PR changes the copy button on the order details to copy the provider order id and not the internal order id.

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@wachunei wachunei requested a review from a team as a code owner July 9, 2025 13:25
@metamaskbot metamaskbot added the team-money-movement issues related to Money Movement features label Jul 9, 2025
cursor[bot]

This comment was marked as outdated.

@cursor cursor Bot 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.

Bug: Unsafe Type Casting Causes UI/Functionality Mismatch

The code unsafely casts order.data to DepositOrder and directly accesses providerOrderId, risking runtime errors if order.data is not the expected type or is undefined. This also creates inconsistent behavior: while the UI displays a fallback internal order ID when providerOrderId is missing, the copy functionality only copies providerOrderId and silently fails, leading to a confusing user experience.

app/components/UI/Ramp/Deposit/components/DepositOrderContent/DepositOrderContent.tsx#L79-L97

const providerOrderId = (order.data as DepositOrder).providerOrderId;
const handleCopyOrderId = useCallback(() => {
if (providerOrderId) {
Clipboard.setString(providerOrderId);
}
}, [providerOrderId]);
const handleViewInTransak = useCallback(() => {
if (
hasDepositOrderField(order?.data, 'providerOrderLink') &&
order.data.providerOrderLink
) {
Linking.openURL(order.data.providerOrderLink);
}
}, [order?.data]);
const shortOrderId = providerOrderId?.slice(-6) ?? order.id.slice(-6);

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2025

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: fe3cd58
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fd1be068-2a5f-4b3e-8f1d-7032d7a5ee98

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@wachunei wachunei added QA Passed QA testing has been completed and passed and removed bitrise-result-ready labels Jul 9, 2025
@wachunei wachunei added this pull request to the merge queue Jul 9, 2025
Merged via the queue into main with commit 598703f Jul 9, 2025
58 of 62 checks passed
@wachunei wachunei deleted the refactor/deposit-copy-order-id branch July 9, 2025 19:50
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 9, 2025
@metamaskbot metamaskbot added the release-7.52.0 Issue or pull request that will be included in release 7.52.0 label Jul 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

QA Passed QA testing has been completed and passed release-7.52.0 Issue or pull request that will be included in release 7.52.0 team-money-movement issues related to Money Movement features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants