Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/232213

Change subject: Set correlationId up front for AstroPay messages
......................................................................

Set correlationId up front for AstroPay messages

Inflight data store was storing all AstroPay messages in the same place.
This shouldn't have caused any data corruption, because it appears that
we never read from the inflight store, just write and delete.

FIXME: Either use the thing to recover from errors or quit writing to it.

Bug: T108995
Change-Id: I9a44d2dc02ae12d639b6db0b75652a3fbfc76617
---
M PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/SmashPig 
refs/changes/13/232213/1

diff --git a/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php 
b/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
index 8d05277..c7673f7 100644
--- a/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
+++ b/PaymentProviders/AstroPay/ExpatriatedMessages/AstroPayMessage.php
@@ -47,6 +47,9 @@
                foreach ( $this->fields as $key ) {
                        $this->$key = ( array_key_exists( $key, $values ) ? 
$values[$key] : '');
                }
+               // Need to set the correlationId during construction
+               // or inflight message store will get confused
+               $this->correlationId = "astropay-{$this->x_document}";
        }
 
        abstract function getDestinationQueue();
@@ -70,8 +73,7 @@
                $queueMsg->gross = $this->x_amount;
                $queueMsg->date = time();
                $queueMsg->gateway_status = $this->result;
-
-               $queueMsg->correlationId = 
"{$queueMsg->gateway}-{$queueMsg->gateway_txn_id}";
+               $queueMsg->correlationId = $this->correlationId;
 
                // This message has no donor info.  Add a key to indicate that 
there is
                // a message in the pending queue with the rest of the info we 
need.

-- 
To view, visit https://gerrit.wikimedia.org/r/232213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a44d2dc02ae12d639b6db0b75652a3fbfc76617
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/SmashPig
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to