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

Fixes #3425: Better support for batch transactions #5437

Merged

Conversation

PaddyMc
Copy link
Contributor

@PaddyMc PaddyMc commented Oct 5, 2018

Fixes #3425

app/_locales/en/messages.json Outdated Show resolved Hide resolved
// if (isEtherTransaction) {
// const pathname = `${CONFIRM_TRANSACTION_ROUTE}/${id}${CONFIRM_SEND_ETHER_PATH}`
// return <Redirect to={{ pathname }} />
// }
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of commenting this out we should be able to remove it

@@ -32,24 +32,24 @@ export default class ConfirmTransactionSwitch extends Component {
txData,
methodData: { name },
fetchingData,
isEtherTransaction,
// isEtherTransaction,
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of commenting this out we should be able to remove it

Copy link
Contributor Author

@PaddyMc PaddyMc Oct 10, 2018

Choose a reason for hiding this comment

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

Awesome, I left it in for the review, it has been removed now. I outlined why I removed this code here.

@bdresser
Copy link
Contributor

@PaddyMc this looks great - pagination between transactions works as expected, and I like the addition of the "go to first" or "go to last" buttons. I've asked @cjeria to take a look to see if there's a slightly smoother visual element we can use 😄

One thing I noticed when testing on this random dapp. Transactions are ordered well, and I can skip through them all. But if I reject the first transaction, it almost always then shows the last transaction of the queue (rather than the next oldest tx).

As per this comment - don't worry about the old UI, we plan to remove it entirely very soon.

Thanks for your patience!

@PaddyMc
Copy link
Contributor Author

PaddyMc commented Oct 16, 2018

@bdresser Thanks, I'm glad you like it! Feel free to ping me when the UX review is completed and I'll complete all the changes requested!

Below is listed the changes that I will make, feel free to add anymore you think of as well:

  1. Update visual elements

  2. Investigate "shows the last transaction of the queue (rather than the next oldest tx)."

  3. Add test case to ensure newly added transactions will not change the transaction currently displayed

  4. Re-order transactions to have oldest first in new UI

@PaddyMc PaddyMc force-pushed the better-support-for-batch-transactions branch from a68c03f to 2a93a0d Compare October 24, 2018 19:54
@PaddyMc
Copy link
Contributor Author

PaddyMc commented Oct 28, 2018

@bdresser Just an fyi, this was updated a few days ago and is ready for review!

@bdresser
Copy link
Contributor

bdresser commented Nov 6, 2018

Hey @PaddyMc, sorry for the delay in reviewing this.

I'm seeing two bits of unexpected behavior, and I'm sorry if we got our wires crossed

(1) for regular transactions, the order they display in the extension and popup are different. I'd expect them to be the same. For example,

  • If I prompt three transactions (for 0.5, 0.6, 0.7 ETH in a row, in the extension they show as
    0.7 ETH (1 of 3), then 0.6 ETH (2 of 3) then 0.5 ETH (3 of 3). This is the correct behavior.
  • However, in the popup I start on 0.5 ETH (3 of 3). I expect to start on 0.7 ETH (1 of 3) as in the extension.
  • I can page through the transactions in the popup, and they're in the proper order (clicking left takes me to 0.6 ETH (2 of 3), then to 0.7 ETH (1 of 3)), I just land on the wrong tx to start. But if I confirm/reject the 0.5 ETH transaction, I jump to the 0.7 ETH transaction. I would expect the popup logic to behave exactly as the extension logic described above.

(2) batch transactions aren't being ordered correctly
they should be displayed in the order they are added to the batch.

  • for the purposes of a shared demo, let's take this example app from the original issue. In the source code we can see the tx are added so they should appear with gas price 2.02, then 3.03, then 1.01.
  • Instead, I get the reverse: 1.01, then 3.03, then 2.02. This seems like it's using the same logic as a "standard" transaction, not the specific logic that should let batch transactions display as they are added to the batch.

Does all this make sense? Again, sorry for the slow back and forth, and please let me know if you have questions. (cc @whymarrh )

@PaddyMc
Copy link
Contributor Author

PaddyMc commented Nov 6, 2018

No problem at all @bdresser .

Thanks for the feedback, I'll update the PR in a few days.

Did you think the spacing for the navigation container and the network container was ok?

@bdresser
Copy link
Contributor

bdresser commented Nov 8, 2018

spacing looks great to me!

as @PaddyMc points out, (1) is a non-issue and is in fact better for security, and (2) is impossible to solve since all tx payloads come in identically.

@whymarrh this is ready to review when you have a sec

@whymarrh whymarrh merged commit 7ce2cf4 into MetaMask:develop Nov 13, 2018
@whymarrh
Copy link
Contributor

Thanks @PaddyMc, this is a solid improvement!

@PaddyMc
Copy link
Contributor Author

PaddyMc commented Nov 13, 2018

Np @whymarrh , happy to help out!

@adamsoffer
Copy link

adamsoffer commented Nov 11, 2019

Hey @PaddyMc @bdresser. Batch transactions are not being submitting sequentially. See here. Is this something you can help with?

@Gudahtt Gudahtt mentioned this pull request Apr 9, 2020
Gudahtt added a commit that referenced this pull request Apr 9, 2020
MetaMask would sometimes get into a state where the notification popup
would never open. This could happen if the notification window was
closed shortly after being opened. After this happened, no popups would
show up until after the extension was reset.

This was happening because the background thought the popup was already
open. The variable it uses to track whether the popup was open or not
was being set to `true` immediately after the background asked the
browser to open a new window, before a handler was attached that could
respond to the window being closed.

Removing this line seems to solve the problem.

This line was added originally in #5437, which dealt with batch
transactions. Batches of transactions seem to work just fine without
this line though (from local testing), and I can't think of why this
would be required.

Closes #7051
Gudahtt added a commit that referenced this pull request Apr 9, 2020
MetaMask would sometimes get into a state where the notification popup
would never open. This could happen if the notification window was
closed shortly after being opened. After this happened, no popups would
show up until after the extension was reset.

This was happening because the background thought the popup was already
open. The variable it uses to track whether the popup was open or not
was being set to `true` immediately after the background asked the
browser to open a new window, before a handler was attached that could
respond to the window being closed.

Removing this line seems to solve the problem.

This line was added originally in #5437, which dealt with batch
transactions. Batches of transactions seem to work just fine without
this line though (from local testing), and I can't think of why this
would be required.

Closes #7051
Gudahtt added a commit that referenced this pull request Apr 28, 2020
This is a backport of #8314. Here's the original description:

MetaMask would sometimes get into a state where the notification popup
would never open. This could happen if the notification window was
closed shortly after being opened. After this happened, no popups would
show up until after the extension was reset.

This was happening because the background thought the popup was already
open. The variable it uses to track whether the popup was open or not
was being set to `true` immediately after the background asked the
browser to open a new window, before a handler was attached that could
respond to the window being closed.

Removing this line seems to solve the problem.

This line was added originally in #5437, which dealt with batch
transactions. Batches of transactions seem to work just fine without
this line though (from local testing), and I can't think of why this
would be required.

Closes #7051
Gudahtt added a commit that referenced this pull request Apr 29, 2020
This is a backport of #8314. Here's the original description:

MetaMask would sometimes get into a state where the notification popup
would never open. This could happen if the notification window was
closed shortly after being opened. After this happened, no popups would
show up until after the extension was reset.

This was happening because the background thought the popup was already
open. The variable it uses to track whether the popup was open or not
was being set to `true` immediately after the background asked the
browser to open a new window, before a handler was attached that could
respond to the window being closed.

Removing this line seems to solve the problem.

This line was added originally in #5437, which dealt with batch
transactions. Batches of transactions seem to work just fine without
this line though (from local testing), and I can't think of why this
would be required.

Closes #7051
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.

Better support for batch transactions
5 participants