Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update signers confirmations #1468

Merged
merged 4 commits into from
Jan 2, 2023

Conversation

DiogoSoaress
Copy link
Member

@DiogoSoaress DiogoSoaress commented Dec 29, 2022

What it solves

Resolves #1374

How this PR fixes it

Adds txQueuedTag to the dependency array to fetch TransactionDetails

How to test it

  1. Create a queued transaction in a Safe with a threshold greater than 1
  2. Expand the transaction in the queue so that TxSigners is visible
  3. Add a confirmation and observe the TxSigners displaying the new data

Analytics changes

N/A

Screenshots

Screenshot 2022-12-29 at 13 23 06

@github-actions
Copy link

github-actions bot commented Dec 29, 2022

Branch preview

✅ Deploy successful!

https://fix_update_tx_signers_confirmations--webcore.review-web-core.5afe.dev

@DiogoSoaress DiogoSoaress requested a review from schmanu December 29, 2022 13:24
@github-actions
Copy link

github-actions bot commented Dec 29, 2022

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

@schmanu schmanu left a comment

Choose a reason for hiding this comment

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

I think we should align the way we refresh our TxDetails with how we do it for SingleTx.

Otherwise for SingleTxs we would refresh twice for instance.

@@ -102,6 +106,22 @@ export const TxSigners = ({
const isPending = useIsPending(txId)
const wallet = useWallet()
const { safe } = useSafeInfo()
const chainId = useChainId()
const [confirmations, setConfirmations] = useState<MultisigConfirmation[]>([])
Copy link
Member

Choose a reason for hiding this comment

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

I would not put this so deep into the TxSigners component.
I think we should refresh and display the entire Transaction details correctly (In the TxDetails component).

Currently it only refreshed the right side (txSigners) but the signatures are also listed in the advanced details on the left side.
Screenshot 2022-12-29 at 16 53 38

}
}, [detailedExecutionInfo])

txSubscribe(TxEvent.SIGNATURE_INDEXED, ({ txId }) => {
Copy link
Member

@schmanu schmanu Dec 29, 2022

Choose a reason for hiding this comment

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

In the TxDetails we already have a bunch of conditions under which we will refresh the details. I would just add the txQueuedTag and txHistoryTag to that array:

const TxDetails = ({
  txSummary,
  txDetails,
}: {
  txSummary: TransactionSummary
  txDetails?: TransactionDetails // optional
}): ReactElement => {
  const chainId = useChainId()
  const { safe } = useSafeInfo()

  const [txDetailsData, error, loading] = useAsync<TransactionDetails>(async () => {
    return txDetails || getTransactionDetails(chainId, txSummary.id)
  }, [txDetails, chainId, txSummary.id, safe.txQueuedTag, safe.txHistoryTag])

// ...
}

That is how we also refresh the tx details for a singleTx in the SingleTx too.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh I didn't think about the tags! I'm going to give it a try

Copy link
Member Author

Choose a reason for hiding this comment

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

I've implemented this way. Thank you for the valuable input!

@DiogoSoaress DiogoSoaress requested a review from schmanu December 29, 2022 17:27
Copy link
Member

@schmanu schmanu left a comment

Choose a reason for hiding this comment

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

Looks good! At some point we could add a test to the TxDetails I guess :)

@francovenica
Copy link
Contributor

I'd prefer it without having it without collapsing and re expanding, but is good and works fine

confirmation refresh

@DiogoSoaress
Copy link
Member Author

DiogoSoaress commented Jan 2, 2023

I'd prefer it without having it without collapsing and re expanding, but is good and works fine

I also didn't like that it was collapsing but we have a rule to collapse it when:

  • the nr of confirmations matches the threshold

meaning that is happening because you're testing a 2/N Safe.

Alternatively we could remove that condition but I'd prefer having that decision coming from design.

Edit:
with the last push it won't collapse / expand the accordion no more and neither the confirmations stepper.

You can recheck it @francovenica 🙌

@francovenica
Copy link
Contributor

Yes. the collapse is not happening anymore, it just reloads the tx description seemsly
no-collapse

@DiogoSoaress DiogoSoaress merged commit b565703 into dev Jan 2, 2023
@DiogoSoaress DiogoSoaress deleted the fix-update-tx-signers-confirmations branch January 2, 2023 14:32
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2023
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.

confirmations list is not updated on tx details without expand/collapse the tx or manual refresh
3 participants