Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Fix: deep-linked tx – use current timestamp as fallback #3146

Merged
merged 2 commits into from
Dec 14, 2021

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Dec 8, 2021

What it solves

Resolves #3069

How this PR fixes it

Navigation to deeplinked transaction after transaction creation was enabled because the error was occurring with this feature. When a deeplinked transaction is opened, and hence loaded from backend via it's txId, the custom frontend-only Transaction typed object is created.

After the immediate creation of a transaction, the fetched transaction may lack a timestamp. As such, the fallback value was changed from 0 to the current timestamp because the transaction was effectively created 'now'. Later polls for transactions will overwrite this with the exact timestamp that is eventually fetched.

How to test it

  1. Create a transaction, adding it to the queue.
  2. Reject said transaction and await for rejection execution.
  3. The transaction details date label and/or list position should now be correct: today.

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

CLA Assistant Lite All Contributors have signed the CLA.

safeAddress,
}),
)
history.push(txRoute)
Copy link
Member Author

Choose a reason for hiding this comment

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

Transaction deeplinking must be enabled to test this ticket. Whether we disabled it again after needs to be decided.

@@ -162,11 +162,13 @@ export const makeTxFromDetails = (txDetails: TransactionDetails): Transaction =>
? txDetails.detailedExecutionInfo
: getMultisigExecutionInfo(txDetails)

// Will only be used as a fallback whilst waiting on backend tx creation cache
const now = new Date().getTime()
Copy link
Member

Choose a reason for hiding this comment

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

JFYI, there's a short version of the same: Date.now() (w/o new).

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

👍

@katspaugh katspaugh changed the title Use current timestamp as fallback Fix: deep-linked tx – use current timestamp as fallback Dec 8, 2021
@github-actions
Copy link

github-actions bot commented Dec 8, 2021

Deployment links

🟠 Safe Rinkeby Safe Mainnet 🟣 Safe Polygon 🟡 Safe BSC Safe Arbitrum 🟢 Safe xDai

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

E2E Tests Failed
Check the results here: https://github.com/gnosis/safe-react-e2e-tests/actions/runs/1555130045

Failed tests:

  • ❌ Address book Address book

@coveralls
Copy link

coveralls commented Dec 8, 2021

Pull Request Test Coverage Report for Build 1555094727

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • 50 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 32.338%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/logic/safe/store/actions/createTransaction.ts 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
src/routes/safe/components/Transactions/TxList/modals/ApproveTxModal.tsx 50 2.76%
Totals Coverage Status
Change from base Build 1555047981: 0.02%
Covered Lines: 3083
Relevant Lines: 8474

💛 - Coveralls

@francovenica
Copy link
Contributor

Safe: https://pr3146--safereact.review-safe.gnosisdev.com/app/rin:0x4816Fae09FdFaF6927E785EFe68E5D68f5740840/transactions/history

It looks good to me. The rejected tx in the history shows immediately in the correct date section

@iamacook iamacook merged commit 2e85e43 into dev Dec 14, 2021
@iamacook iamacook deleted the wrong-deeplink-dates branch December 14, 2021 08:28
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deep link - Rejected tx shows in the wrong date for a while
4 participants