gui: Prevent processing duplicate payment requests #17031

pull promag wants to merge 1 commits into bitcoin:master from promag:2019-10-fix-paymentserver changing 1 files +6 −4
  1. promag commented at 9:13 PM on October 2, 2019: member

    Considering the following from Qt src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm#L267

    - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
    {
        Q_UNUSED(filenames);
        Q_UNUSED(sender);
    
        for (NSString *fileName in filenames) {
            QString qtFileName = QString::fromNSString(fileName);
            if (inLaunch) {
                // We need to be careful because Cocoa will be nice enough to take
                // command line arguments and send them to us as events. Given the history
                // of Qt Applications, this will result in behavior people don't want, as
                // they might be doing the opening themselves with the command line parsing.
                if (qApp->arguments().contains(qtFileName))
                    continue;
            }
            QWindowSystemInterface::handleFileOpenEvent(qtFileName);
        }
    

    And that a2714a5c69f0b0506689af04c3e785f71ee0915d was merged, now Qt isn't able to filter out the above notifications, and then a QFileOpenEvent event is delivered to PaymentServer::eventFilter, which in turn (re)adds the payment request.

    This change fixes #17025, but makes sense regardless of the issue.

  2. Prevent processing duplicate payment requests 3f89e1eb23
  3. MarcoFalke added this to the milestone 0.19.0 on Oct 2, 2019
  4. MarcoFalke renamed this:
    Prevent processing duplicate payment requests
    gui: Prevent processing duplicate payment requests
    on Oct 2, 2019
  5. DrahtBot added the label GUI on Oct 2, 2019
  6. laanwj commented at 3:14 AM on October 3, 2019: member

    Concept ACK, but is there is no specific way to recognize and ignore these Mac-only events?

    Changing the code for all platforms here last-minute seems a bit risky.

    If you do this, this needs a comment at the handling site that payment requests can be duplicated due to platform-specific "features" and that's why it is like this.

    Edit: What about ignoring the command line passed URIs on MacOSX, because we know we'll get notification for them anyway?

  7. laanwj commented at 3:58 AM on October 3, 2019: member

    Though I guess this fixes #2302 as well?

  8. promag commented at 6:56 AM on October 3, 2019: member

    Edit: What about ignoring the command line passed URIs on MacOSX, because we know we'll get notification for them anyway?

    Other options:

    • during init, compare QFileOpenEvent path with the ones from argv and ignore if duplicate
    • pass non-options to QApplication so that Qt behavior remains the same.

    But this change also prevents processing duplicate payments from the command line, like

    bitcoin-qt -regtest "bitcoin:bcrt1qu7nl0nxfqwhrrf6v0t60asvq3dympgqdhg03rn?amount=0.00010000" "bitcoin:bcrt1qu7nl0nxfqwhrrf6v0t60asvq3dympgqdhg03rn?amount=0.00010000"
    
  9. laanwj commented at 9:38 AM on October 3, 2019: member

    Nah, this seems fine, utACK 3f89e1eb237efcbd6415ca2cd0acddb6596153d7

  10. Sjors commented at 4:30 PM on October 3, 2019: member

    ACK 3f89e1e on macOS 10.14.6

  11. achow101 commented at 5:18 PM on October 3, 2019: member

    Code review ACK 3f89e1eb237efcbd6415ca2cd0acddb6596153d7

  12. laanwj added the label Needs backport on Oct 3, 2019
  13. fanquake referenced this in commit 8ddc303931 on Oct 4, 2019
  14. fanquake merged this on Oct 4, 2019
  15. fanquake closed this on Oct 4, 2019

  16. laanwj referenced this in commit bd22dea633 on Oct 4, 2019
  17. laanwj removed the label Needs backport (0.19) on Oct 4, 2019
  18. sidhujag referenced this in commit 284ca76638 on Oct 4, 2019
  19. HashUnlimited referenced this in commit 506286b40f on Nov 17, 2019
  20. fxtc referenced this in commit 7bd29d134e on Nov 25, 2019
  21. fxtc referenced this in commit 499912a258 on Nov 25, 2019
  22. promag deleted the branch on Mar 4, 2020
  23. PastaPastaPasta referenced this in commit 9b97cb680f on Jun 27, 2021
  24. PastaPastaPasta referenced this in commit 9a3a19336b on Jun 28, 2021
  25. PastaPastaPasta referenced this in commit 331e87dd3a on Jun 29, 2021
  26. PastaPastaPasta referenced this in commit 3863c8ab3b on Jul 1, 2021
  27. PastaPastaPasta referenced this in commit 0fd2a44c7a on Jul 1, 2021
  28. PastaPastaPasta referenced this in commit 040b920900 on Jul 12, 2021
  29. PastaPastaPasta referenced this in commit 45029ee33f on Jul 13, 2021
  30. PastaPastaPasta referenced this in commit d96e363a3f on Jul 13, 2021
  31. deadalnix referenced this in commit 34677583c7 on Aug 24, 2021
  32. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me