Add Token SAC review re-fetches fee + scan data the Add Token screen already loaded
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start in extension/src/popup/components/manageAssets/ManageAssetRows/ChangeTrustInternal/index.tsx and trace the Add Token screen’s props, useNetworkFees, and useChangeTrustData flow. Confirm the current useGetAppData/redux data is referentially stable, then verify existing tests still pass. Done means the review uses the already-loaded recommendedFee and scan result without duplicate feeStats or scanAsset requests.
Written by the indexing model from the issue text.
Description
Summary
In the Add Token → SAC trustline review flow, ChangeTrustInternal re-fetches
data that the Add Token screen already loaded, adding avoidable latency and
duplicate backend requests. Not user-visible beyond the extra round-trips.
Follow-up from the PR #2869 review (finding #6, [efficiency]).
Details
extension/src/popup/components/manageAssets/ManageAssetRows/ChangeTrustInternal/index.tsx
- Duplicate
feeStats()round-trip.ChangeTrustInternalcalls
useNetworkFees()again even though the Add Token screen already fetched fees.
OnlyinitialFeeis threaded down from the parent — notrecommendedFee— so
the child re-fetches to recover it. - Duplicate
scanAsset.useChangeTrustDatare-runsscanAssetfor the
same${code}-${issuer}the Add Token screen already scanned; the prior scan
result is not threaded down.
Proposed fix
Thread the already-fetched recommendedFee and the Add Token scan result down
into ChangeTrustInternal (via props) instead of re-fetching them in the child.
Related note to verify (not necessarily blocking)
fetchData is useCallback-memoized with networkDetails in its dep array and
the effect depends on [fetchData]. This is correct only while the
networkDetails prop is referentially stable. If a parent ever passes a
freshly-constructed networkDetails each render, the memo breaks and fetchData
re-fires every render. Current tests pass, so the useGetAppData/redux source
appears stable — worth a quick confirmation while in this code.
Context
- Source: local PR review of #2869 (
feat/addtoken-sac-changetrust-review), headb314de9b. - Severity: low (latency / duplicate requests only; no correctness or security impact).
- Dominant language
- TypeScript
- Stars
- 122
- Forks
- 62
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 41
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 stellar/freighter
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Write the banner publishing guidePossibly taken @aristidesstaffieri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stellar/freighter#3152 · 1 assignee ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
Dont call blockaid on empty token listMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 2 days
-
follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
All issues in stellar/freighter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zabuton-app/meguri#875 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
iruzen-dono/workless#117 ·
Maintainers usually reply within 1 day
-
area:api area:web wave wave:trivial
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vetro-protocol/vetro-monorepo#1321 ·
Maintainers usually reply within 1 day