From cdf551d9aeee90b3133a74a9e7858a9a5052b5cc Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 28 Jan 2013 10:48:26 -0800 Subject: MAINT-2287 : WIP : Implement a market place state --- indra/newview/llmarketplacefunctions.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 0b009b68f7..d3daf605e0 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -141,6 +141,7 @@ namespace LLMarketplaceImport if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) || (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || + (status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) @@ -187,6 +188,7 @@ namespace LLMarketplaceImport } if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || + (status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) @@ -356,6 +358,7 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter() : mAutoTriggerImport(false) , mImportInProgress(false) , mInitialized(false) + , mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED) , mErrorInitSignal(NULL) , mStatusChangedSignal(NULL) , mStatusReportSignal(NULL) @@ -398,13 +401,19 @@ void LLMarketplaceInventoryImporter::initialize() if (!LLMarketplaceImport::hasSessionCookie()) { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING; LLMarketplaceImport::establishMarketplaceSessionCookie(); } + else + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT; + } } void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport() { mInitialized = false; + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED(); initialize(); -- cgit v1.2.3 From 158393c404422bcc7b21d736d15a22ba6857dd04 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 28 Jan 2013 11:01:14 -0800 Subject: MAINT-2287 : WIP : Fix compile issue --- indra/newview/llmarketplacefunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d3daf605e0..5da615d37b 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -413,7 +413,7 @@ void LLMarketplaceInventoryImporter::initialize() void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport() { mInitialized = false; - mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED(); + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED; initialize(); -- cgit v1.2.3 From c8e76908d71a67355beecf22c4daa8d0a50ef08e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 28 Jan 2013 18:32:47 -0800 Subject: MAINT-2287 : Fixed : Test the merchant/no merchant status without relying on outbox, Recreate missing outbox for a merchant, UI clean up on init. --- indra/newview/llmarketplacefunctions.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 5da615d37b..becdfa1ddc 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -414,9 +414,7 @@ void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport() { mInitialized = false; mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED; - initialize(); - mAutoTriggerImport = true; } @@ -468,17 +466,21 @@ void LLMarketplaceInventoryImporter::updateImport() if (mInitialized) { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT; // Follow up with auto trigger of import if (mAutoTriggerImport) { mAutoTriggerImport = false; - mImportInProgress = triggerImport(); } } - else if (mErrorInitSignal) + else { - (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); + mMarketPlaceStatus = (LLMarketplaceImport::getResultStatus() == MarketplaceErrorCodes::IMPORT_FORBIDDEN ? MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT : MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE); + if (mErrorInitSignal && (mMarketPlaceStatus == MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE)) + { + (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); + } } } } -- cgit v1.2.3 From 677f65b3a2f863895250f1c25f91c79e43810caf Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 31 Jan 2013 20:26:59 -0800 Subject: MAINT-2301 : WIP : Catch a bit more 4xx and 5xx error codes, display the error code in the alert. --- indra/newview/llmarketplacefunctions.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index becdfa1ddc..79d663ead8 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -135,20 +135,15 @@ namespace LLMarketplaceImport llinfos << " SLM POST status: " << status << llendl; llinfos << " SLM POST reason: " << reason << llendl; llinfos << " SLM POST content: " << content.asString() << llendl; - llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl; } - if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) || - (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || - (status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || - (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)) + if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM POST clearing marketplace cookie due to authentication failure or timeout" << llendl; + llinfos << " SLM POST clearing marketplace cookie due to client or server error" << llendl; } - sMarketplaceCookie.clear(); } @@ -183,19 +178,15 @@ namespace LLMarketplaceImport llinfos << " SLM GET status: " << status << llendl; llinfos << " SLM GET reason: " << reason << llendl; llinfos << " SLM GET content: " << content.asString() << llendl; - llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl; } - if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || - (status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || - (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)) + if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM GET clearing marketplace cookie due to authentication failure or timeout" << llendl; + llinfos << " SLM GET clearing marketplace cookie due to client or server error" << llendl; } - sMarketplaceCookie.clear(); } @@ -476,7 +467,17 @@ void LLMarketplaceInventoryImporter::updateImport() } else { - mMarketPlaceStatus = (LLMarketplaceImport::getResultStatus() == MarketplaceErrorCodes::IMPORT_FORBIDDEN ? MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT : MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE); + U32 status = LLMarketplaceImport::getResultStatus(); + if ((status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || + (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || + (status == MarketplaceErrorCodes::IMPORT_NOT_FOUND)) + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT; + } + else + { + mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE; + } if (mErrorInitSignal && (mMarketPlaceStatus == MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE)) { (*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults()); -- cgit v1.2.3 From bb841e7d21a4baf25e5dd240bc4776c853710ac9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 31 Jan 2013 22:04:27 -0800 Subject: MAINT-2301 : Fixed : Ignoring 499 timeout errors on POST (safe). --- indra/newview/llmarketplacefunctions.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 79d663ead8..2eeaebf823 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -138,6 +138,16 @@ namespace LLMarketplaceImport llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl; } + // MAINT-2301 : we determined we can safely ignore that error in that context + if (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT) + { + if (gSavedSettings.getBOOL("InventoryOutboxLogging")) + { + llinfos << " SLM POST : Ignoring time out status and treating it as success" << llendl; + } + status = MarketplaceErrorCodes::IMPORT_DONE; + } + if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) -- cgit v1.2.3 From df54caf6f93b164eef1a0a64cc173be67d762041 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 15 Feb 2013 12:09:23 -0800 Subject: MAINT-2301 : Do not treat 404 errors (server returns not found) as 403 errors (forbidden, i.e. resident is not a merchant) --- indra/newview/llmarketplacefunctions.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 2eeaebf823..d6954dc75b 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -479,8 +479,7 @@ void LLMarketplaceInventoryImporter::updateImport() { U32 status = LLMarketplaceImport::getResultStatus(); if ((status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) || - (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) || - (status == MarketplaceErrorCodes::IMPORT_NOT_FOUND)) + (status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR)) { mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT; } -- cgit v1.2.3 From 792eda047b5dcf35f3c2fad95a543a62eaeb1140 Mon Sep 17 00:00:00 2001 From: merov_linden Date: Thu, 7 Mar 2013 20:43:20 -0800 Subject: MAINT-2452 : Fixed : Do not clear the cookie in IMPORT_DONE_WITH_ERRORS case so future retry have a chance to work. --- indra/newview/llmarketplacefunctions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index d6954dc75b..214558c459 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -191,7 +191,9 @@ namespace LLMarketplaceImport llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl; } - if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) + // MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS + if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) && + (status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { -- cgit v1.2.3 From 0cf0efb6e31d505bc079f757fe7d832110797199 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 25 Mar 2013 19:03:49 -0700 Subject: WENG-618 : Added debug printout for POST and GET when InventoryOutboxLogging is turned on --- indra/newview/llmarketplacefunctions.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 214558c459..835615723a 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "llhttpclient.h" +#include "llsdserialize.h" #include "lltimer.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -201,6 +202,10 @@ namespace LLMarketplaceImport } sMarketplaceCookie.clear(); } + else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)) + { + llinfos << " SLM GET : Got IMPORT_DONE_WITH_ERRORS, marketplace cookie not cleared." << llendl; + } sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING); sImportGetPending = false; @@ -261,7 +266,12 @@ namespace LLMarketplaceImport if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM GET: " << url << llendl; + llinfos << " SLM GET: establishMarketplaceSessionCookie, LLHTTPClient::get, url = " << url << llendl; + LLSD headers = LLViewerMedia::getHeaders(); + std::stringstream str; + LLSDSerialize::toPrettyXML(headers, str); + llinfos << " SLM GET: headers " << llendl; + llinfos << str.str() << llendl; } slmGetTimer.start(); @@ -292,7 +302,11 @@ namespace LLMarketplaceImport if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM GET: " << url << llendl; + llinfos << " SLM GET: pollStatus, LLHTTPClient::get, url = " << url << llendl; + std::stringstream str; + LLSDSerialize::toPrettyXML(headers, str); + llinfos << " SLM GET: headers " << llendl; + llinfos << str.str() << llendl; } slmGetTimer.start(); @@ -326,11 +340,15 @@ namespace LLMarketplaceImport if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { - llinfos << " SLM POST: " << url << llendl; + llinfos << " SLM POST: triggerImport, LLHTTPClient::post, url = " << url << llendl; + std::stringstream str; + LLSDSerialize::toPrettyXML(headers, str); + llinfos << " SLM POST: headers " << llendl; + llinfos << str.str() << llendl; } slmPostTimer.start(); - LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers); + LLHTTPClient::post(url, LLSD(), new LLImportPostResponder(), headers); return true; } -- cgit v1.2.3 From 8af432481db885afe215ef51da749543a59f3c6a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 19 Nov 2013 16:15:00 -0800 Subject: ACME-3319 : Consolidate Merchant Outboxes when several are present into one in the right place --- indra/newview/llmarketplacefunctions.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 835615723a..f01a3de16c 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -418,7 +418,10 @@ boost::signals2::connection LLMarketplaceInventoryImporter::setStatusReportCallb void LLMarketplaceInventoryImporter::initialize() { - llassert(!mInitialized); + if (mInitialized) + { + return; + } if (!LLMarketplaceImport::hasSessionCookie()) { -- cgit v1.2.3 From 1897e6ce87d260364d2aad1b1f3fa67e5f2e0d04 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 27 Nov 2013 12:20:06 -0800 Subject: ACME-1221 : Do not clear merchant import cookie on 404, happens to newly minted merchants --- indra/newview/llmarketplacefunctions.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview/llmarketplacefunctions.cpp') diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index f01a3de16c..05c9d76810 100755 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -192,9 +192,11 @@ namespace LLMarketplaceImport llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl; } - // MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS + // MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS : Happens when trying to import objects with wrong permissions + // ACME-1221 : Do not clear the cookie on IMPORT_NOT_FOUND : Happens for newly created Merchant accounts that are initally empty if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) && - (status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)) + (status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) && + (status != MarketplaceErrorCodes::IMPORT_NOT_FOUND)) { if (gSavedSettings.getBOOL("InventoryOutboxLogging")) { @@ -202,9 +204,9 @@ namespace LLMarketplaceImport } sMarketplaceCookie.clear(); } - else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS)) + else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)) { - llinfos << " SLM GET : Got IMPORT_DONE_WITH_ERRORS, marketplace cookie not cleared." << llendl; + llinfos << " SLM GET : Got error status = " << status << ", but marketplace cookie not cleared." << llendl; } sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING); -- cgit v1.2.3