Payments are marking the spender as the affiliate in some cases
Summary
(Summarize the bug encountered concisely)
Steps to reproduce
SELECT payment_guid, user_guid, affiliate_user_guid, created_timestamp FROM minds_payments
WHERE affiliate_user_guid = user_guid;
+-------------------+-------------------+-------------------+---------------------+
|payment_guid |user_guid |affiliate_user_guid|created_timestamp |
+-------------------+-------------------+-------------------+---------------------+
|1497981228404445199|1373405843034214405|1373405843034214405|2023-04-26 15:22:35.0|
|1498028220887339018|653785905877753874 |653785905877753874 |2023-04-26 18:29:19.0|
|1498129108591185923|964957909425332225 |964957909425332225 |2023-04-27 01:10:13.0|
|1498153656908779521|964957909425332225 |964957909425332225 |2023-04-27 02:47:46.0|
|1498273062808719373|647843641284370442 |647843641284370442 |2023-04-27 10:42:14.0|
|1498277324708122634|653785905877753874 |653785905877753874 |2023-04-27 10:59:10.0|
|1498277546062516232|653785905877753874 |653785905877753874 |2023-04-27 11:00:03.0|
|1498429417385365507|737692121632350222 |737692121632350222 |2023-04-27 21:03:32.0|
|1498453275458932754|737692121632350222 |737692121632350222 |2023-04-27 22:38:20.0|
|1498585044770361345|964957909425332225 |964957909425332225 |2023-04-28 07:21:57.0|
|1498675137925353473|1147857380176830481|1147857380176830481|2023-04-28 13:19:56.0|
|1498780436531253254|980971187775479822 |980971187775479822 |2023-04-28 20:18:22.0|
|1498909489674326033|877186407880204307 |877186407880204307 |2023-04-29 04:51:10.0|
|1498984584455393288|970959432131289095 |970959432131289095 |2023-04-29 09:49:34.0|
|1498999650554744850|970959432131289095 |970959432131289095 |2023-04-29 10:49:26.0|
|1499043729632137221|793753388541026308 |793753388541026308 |2023-04-29 13:44:36.0|
|1499087634465558530|653785905877753874 |653785905877753874 |2023-04-29 16:39:03.0|
|1499087749989273611|653785905877753874 |653785905877753874 |2023-04-29 16:39:31.0|
|1499318836132843527|653785905877753874 |653785905877753874 |2023-04-30 07:57:46.0|
|1499425205750075398|1194561366392840205|1194561366392840205|2023-04-30 15:00:27.0|
|1499429194369601541|1356430994386718738|1356430994386718738|2023-04-30 15:16:17.0|
|1499438687199432723|1428466235430932483|1428466235430932483|2023-04-30 15:54:01.0|
|1499756497075179529|1139392374170984459|1139392374170984459|2023-05-01 12:56:53.0|
|1499849832079036421|1196204062962360328|1196204062962360328|2023-05-01 19:07:45.0|
|1499866507658661895|1327318588461158420|1327318588461158420|2023-05-01 20:14:01.0|
|1499931395848409100|1196204062962360328|1196204062962360328|2023-05-02 00:31:52.0|
|1500017104051507219|1196204062962360328|1196204062962360328|2023-05-02 06:12:26.0|
|1500047592875102226|1453803321268637706|1453803321268637706|2023-05-02 08:13:35.0|
|1500136272193130509|1196204062962360328|1196204062962360328|2023-05-02 14:05:58.0|
|1500232506710953999|698078528637247508 |698078528637247508 |2023-05-02 20:28:22.0|
|1500311725503680528|1196204062962360328|1196204062962360328|2023-05-03 01:43:09.0|
|1500331534182256653|1196204062962360328|1196204062962360328|2023-05-03 03:01:52.0|
|1500416304673198081|980971187775479822 |980971187775479822 |2023-05-03 08:38:43.0|
|1500464110796541963|1196204062962360328|1196204062962360328|2023-05-03 11:48:41.0|
|1500471354183389189|1196204062962360328|1196204062962360328|2023-05-03 12:17:28.0|
+-------------------+-------------------+-------------------+---------------------+
Platform information
Web
What is the current bug behavior?
The affiliate_user_guid is the same as the spender (user_guid)
What is the expected correct behavior?
We should not be recording an affiliate_user_guid if it is the same as the spender.
Further investigation needed as to why this is happening.
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Edited by Mark Harding