From 0c922b6351fa7c777077f9e3a1c7e0a84ef7200c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> Date: Thu, 3 Sep 2026 18:30:03 +0300 Subject: #6245 Fix symbol upload to use xcarchive correctly --- .github/workflows/build.yaml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d19c2f1c02..cfce3b06b7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -488,6 +488,8 @@ jobs: node-version: "22" dumpSyms: false + # Upload can be failure prone and we might need to reupload in some cases, + # Keep upload as a separate job, to not require full rebuild on upload failure. post-mac-symbols: env: BUGSPLAT_DATABASE: "${{ secrets.BUGSPLAT_DATABASE }}" @@ -502,6 +504,20 @@ jobs: uses: actions/download-artifact@v8 with: name: macOS-symbols + - name: Extract dSYM bundles + if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID + shell: bash + run: | + mkdir -p _mac_symbols + shopt -s nullglob globstar + archives=( **/*.xcarchive.zip ) + if [ ${#archives[@]} -eq 0 ]; then + echo "No .xcarchive.zip archives found in downloaded macOS-symbols artifact" + exit 1 + fi + for archive in "${archives[@]}"; do + unzip -q "$archive" -d _mac_symbols + done - name: Post Mac symbols if: env.BUGSPLAT_DATABASE && env.SYMBOL_UPLOAD_CLIENT_ID uses: BugSplat-Git/symbol-upload@3857759bd957dadb075509a4e951f04f9baa5ea3 @@ -511,8 +527,8 @@ jobs: database: "${{ env.BUGSPLAT_DATABASE }}" application: ${{ needs.build.outputs.viewer_channel }} version: ${{ needs.build.outputs.viewer_version }} (${{ needs.build.outputs.viewer_version }}) - directory: . - files: "**/*.xcarchive.zip" + directory: _mac_symbols + files: "**/*.dSYM" node-version: "22" dumpSyms: false -- cgit v1.3 From 09cdedb147db175e38d08b9a6020b8bd3d07dc91 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 10 Aug 2026 20:56:05 +0300 Subject: Replace LLFloaterBuyCurrencyHTML with new L$ packs web floater --- indra/newview/app_settings/settings.xml | 24 ++++- indra/newview/llbuycurrencyhtml.cpp | 19 ++-- indra/newview/llbuycurrencyhtml.h | 6 +- indra/newview/llfloaterbuycurrencyhtml.cpp | 103 ++++++--------------- indra/newview/llfloaterbuycurrencyhtml.h | 43 ++++----- .../default/xui/en/floater_buy_currency_html.xml | 17 ++-- 6 files changed, 83 insertions(+), 129 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ad307f9648..459f8c1b42 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1172,6 +1172,28 @@ Value 1 + BuyCurrencyHTML + + Comment + Use HTML based L$ packs floater instead of legacy XUI version + Persist + 1 + Type + Boolean + Value + 1 + + BuyCurrencyPacksURL + + Comment + URL for the L$ packs purchase floater + Persist + 1 + Type + String + Value + https://accounts.secondlife.com/packs/floater?lang=[LANGUAGE]&shortfall=[SHORTFALL] + EnableButtonFlashing Comment @@ -7182,7 +7204,7 @@ QuickBuyCurrency Comment - Toggle between HTML based currency purchase floater and legacy XUI version + (Deprecated) Use BuyCurrencyHTML instead Persist 1 Type diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index e6c4d44573..8469eaa6ff 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -89,14 +89,14 @@ LLBuyCurrencyHTMLHandler gBuyCurrencyHTMLHandler; //////////////////////////////////////////////////////////////////////////////// // static // Opens the legacy XUI based floater or new HTML based one based on -// the QuickBuyCurrency value in settings.xml - this overload is for +// the BuyCurrencyHTML value in settings.xml - this overload is for // the case where the amount is not requested. void LLBuyCurrencyHTML::openCurrencyFloater() { - if ( gSavedSettings.getBOOL( "QuickBuyCurrency" ) ) + if ( gSavedSettings.getBOOL( "BuyCurrencyHTML" ) ) { // HTML version - LLBuyCurrencyHTML::showDialog( false, "", 0 ); + LLBuyCurrencyHTML::showDialog(); } else { @@ -108,14 +108,13 @@ void LLBuyCurrencyHTML::openCurrencyFloater() //////////////////////////////////////////////////////////////////////////////// // static // Opens the legacy XUI based floater or new HTML based one based on -// the QuickBuyCurrency value in settings.xml - this overload is for +// the BuyCurrencyHTML value in settings.xml - this overload is for // the case where the amount and a string to display are requested. void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum ) { - if ( gSavedSettings.getBOOL( "QuickBuyCurrency" ) ) + if ( gSavedSettings.getBOOL( "BuyCurrencyHTML" ) ) { - // HTML version - LLBuyCurrencyHTML::showDialog( true, message, sum ); + LLBuyCurrencyHTML::showDialog(sum - gStatusBar->getBalance()); } else { @@ -126,13 +125,13 @@ void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum //////////////////////////////////////////////////////////////////////////////// // static -void LLBuyCurrencyHTML::showDialog( bool specific_sum_requested, const std::string& message, S32 sum ) +void LLBuyCurrencyHTML::showDialog(S32 shortfall) { LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >( LLFloaterReg::getInstance( "buy_currency_html" ) ); if ( buy_currency_floater ) { // pass on flag indicating if we want to buy specific amount and if so, how much - buy_currency_floater->setParams( specific_sum_requested, message, sum ); + buy_currency_floater->setShortfall(shortfall); // force navigate to new URL buy_currency_floater->navigateToFinalURL(); @@ -144,7 +143,7 @@ void LLBuyCurrencyHTML::showDialog( bool specific_sum_requested, const std::stri buy_currency_floater->setFrontmost( take_focus ); // spec calls for floater to be centered on client window - buy_currency_floater->center(); + //buy_currency_floater->center(); } else { diff --git a/indra/newview/llbuycurrencyhtml.h b/indra/newview/llbuycurrencyhtml.h index 5e3d30dcd0..54ee82159d 100644 --- a/indra/newview/llbuycurrencyhtml.h +++ b/indra/newview/llbuycurrencyhtml.h @@ -29,8 +29,6 @@ #include "llsingleton.h" -class LLFloaterBuyCurrencyHTML; - class LLBuyCurrencyHTML { public: @@ -41,8 +39,8 @@ class LLBuyCurrencyHTML static void openCurrencyFloater( const std::string& message, S32 sum ); // show and give focus to actual currency floater - this is used for both cases - // where the sum is required and where it is not - static void showDialog( bool specific_sum_requested, const std::string& message, S32 sum ); + // where the shortfall is required and where it is not + static void showDialog( S32 shortfall = 0 ); // close (and destroy) the currency floater static void closeDialog(); diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index d3712869b0..24ec43e7e4 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2026, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,97 +27,46 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterbuycurrencyhtml.h" -#include "llhttpconstants.h" -#include "llstatusbar.h" +#include "llmediactrl.h" +#include "llviewercontrol.h" +#include "llweb.h" -//////////////////////////////////////////////////////////////////////////////// -// -LLFloaterBuyCurrencyHTML::LLFloaterBuyCurrencyHTML( const LLSD& key ): - LLFloater( key ), - mSpecificSumRequested( false ), - mMessage( "" ), - mSum( 0 ) + +LLFloaterBuyCurrencyHTML::LLFloaterBuyCurrencyHTML(const LLSD& key) + : LLFloater(key), + mBrowser(nullptr) { } -//////////////////////////////////////////////////////////////////////////////// -// -bool LLFloaterBuyCurrencyHTML::postBuild() +LLFloaterBuyCurrencyHTML::~LLFloaterBuyCurrencyHTML() { - // observer media events - mBrowser = getChild( "browser" ); - mBrowser->addObserver( this ); +} +bool LLFloaterBuyCurrencyHTML::postBuild() +{ + mBrowser = getChild("browser"); + mBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); + LLViewerMedia::getInstance()->getOpenIDCookie(mBrowser); return true; } -//////////////////////////////////////////////////////////////////////////////// -// void LLFloaterBuyCurrencyHTML::navigateToFinalURL() { - // URL for actual currency buy contents is in XUI file - std::string buy_currency_url = getString( "buy_currency_url" ); + std::string buy_currency_url = gSavedSettings.getString("BuyCurrencyPacksURL"); - // replace [LANGUAGE] meta-tag with view language LLStringUtil::format_map_t replace; - - // viewer language - replace[ "[LANGUAGE]" ] = LLUI::getLanguage(); - - // flag that specific amount requested - replace[ "[SPECIFIC_AMOUNT]" ] = ( mSpecificSumRequested ? "y":"n" ); - - // amount requested - std::ostringstream codec( "" ); - codec << mSum; - replace[ "[SUM]" ] = codec.str(); - - // users' current balance - codec.clear(); - codec.str( "" ); - codec << gStatusBar->getBalance(); - replace[ "[BAL]" ] = codec.str(); - - // message - "This cost L$x,xxx for example - replace[ "[MSG]" ] = LLURI::escape( mMessage ); - LLStringUtil::format( buy_currency_url, replace ); - - // write final URL to debug console - LL_INFOS() << "Buy currency HTML parsed URL is " << buy_currency_url << LL_ENDL; - - // kick off the navigation - mBrowser->navigateTo( buy_currency_url, HTTP_CONTENT_TEXT_HTML ); -} - -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterBuyCurrencyHTML::handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event ) -{ - // placeholder for now - just in case we want to catch media events - if ( LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event ) + replace["[LANGUAGE]"] = LLUI::getLanguage(); + if (mShortfall > 0) { - // update currency after we complete a navigation since there are many ways - // this can result in a different L$ balance - LLStatusBar::sendMoneyBalanceRequest(); - }; -} + replace["[SHORTFALL]"] = std::to_string(mShortfall); + } -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterBuyCurrencyHTML::onClose( bool app_quitting ) -{ - // Update L$ balance one more time - LLStatusBar::sendMoneyBalanceRequest(); + LLStringUtil::format(buy_currency_url, replace); - destroy(); -} + if (mShortfall <= 0) + { + LLStringUtil::replaceString(buy_currency_url, "&shortfall=[SHORTFALL]", ""); + } -//////////////////////////////////////////////////////////////////////////////// -// -void LLFloaterBuyCurrencyHTML::setParams( bool specific_sum_requested, const std::string& message, S32 sum ) -{ - // save these away - used to construct URL later - mSpecificSumRequested = specific_sum_requested; - mMessage = message; - mSum = sum; + mBrowser->navigateTo(buy_currency_url, HTTP_CONTENT_TEXT_HTML); } diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h index 23a29cae4c..e8dbd0a716 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.h +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * Copyright (C) 2026, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,36 +24,25 @@ * $/LicenseInfo$ */ -#ifndef LL_LLFLOATERBUYCURRENCYHTML_H -#define LL_LLFLOATERBUYCURRENCYHTML_H +#pragma once #include "llfloater.h" #include "llmediactrl.h" -class LLFloaterBuyCurrencyHTML : - public LLFloater, - public LLViewerMediaObserver +class LLFloaterBuyCurrencyHTML: + public LLFloater { - public: - LLFloaterBuyCurrencyHTML( const LLSD& key ); - - /*virtual*/ bool postBuild(); - /*virtual*/ void onClose( bool app_quitting ); - - // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event ); - - // allow our controlling parent to tell us paramters - void setParams( bool specific_sum_requested, const std::string& message, S32 sum ); - - // parse and construct URL and set browser to navigate there. - void navigateToFinalURL(); - - private: - LLMediaCtrl* mBrowser; - bool mSpecificSumRequested; - std::string mMessage; - S32 mSum; + friend class LLFloaterReg; + +public: + LLFloaterBuyCurrencyHTML(const LLSD& key); + ~LLFloaterBuyCurrencyHTML(); + bool postBuild() override; + void navigateToFinalURL(); + void setShortfall(S32 shortfall) { mShortfall = shortfall; } + +private: + LLMediaCtrl* mBrowser; + S32 mShortfall{0}; }; -#endif // LL_LLFLOATERBUYCURRENCYHTML_H diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml index 996937cd45..782d45120b 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml @@ -1,20 +1,17 @@ - - https://quick-buy.secondlife.com/[LANGUAGE]/display/?sa=[SPECIFIC_AMOUNT]&sum=[SUM]&msg=[MSG]&bal=[BAL] - + title="BUY L$"> Date: Tue, 11 Aug 2026 19:13:13 +0300 Subject: Refresh L$ balance on floater close and on successful purchase navigation --- indra/newview/llbuycurrencyhtml.cpp | 3 --- indra/newview/llfloaterbuycurrencyhtml.cpp | 19 +++++++++++++++++++ indra/newview/llfloaterbuycurrencyhtml.h | 6 +++++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index 8469eaa6ff..0ae3b6eb4a 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -160,7 +160,4 @@ void LLBuyCurrencyHTML::closeDialog() { buy_currency_floater->closeFloater(); }; - - // Update L$ balance in the status bar in case L$ were purchased - LLStatusBar::sendMoneyBalanceRequest(); } diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index 24ec43e7e4..488bd088c1 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -28,6 +28,7 @@ #include "llfloaterbuycurrencyhtml.h" #include "llmediactrl.h" +#include "llstatusbar.h" #include "llviewercontrol.h" #include "llweb.h" @@ -42,9 +43,18 @@ LLFloaterBuyCurrencyHTML::~LLFloaterBuyCurrencyHTML() { } +void LLFloaterBuyCurrencyHTML::onClose(bool app_quitting) +{ + if (!app_quitting) + LLStatusBar::sendMoneyBalanceRequest(); + + LLFloater::onClose(app_quitting); +} + bool LLFloaterBuyCurrencyHTML::postBuild() { mBrowser = getChild("browser"); + mBrowser->addObserver(this); mBrowser->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL")); LLViewerMedia::getInstance()->getOpenIDCookie(mBrowser); return true; @@ -70,3 +80,12 @@ void LLFloaterBuyCurrencyHTML::navigateToFinalURL() mBrowser->navigateTo(buy_currency_url, HTTP_CONTENT_TEXT_HTML); } + +void LLFloaterBuyCurrencyHTML::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if ((LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event) && + (self->getNavigateURI().find("done=success") != std::string::npos)) + { + LLStatusBar::sendMoneyBalanceRequest(); + } +} diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h index e8dbd0a716..80e368e607 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.h +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -30,7 +30,8 @@ #include "llmediactrl.h" class LLFloaterBuyCurrencyHTML: - public LLFloater + public LLFloater, + public LLViewerMediaObserver { friend class LLFloaterReg; @@ -38,6 +39,9 @@ public: LLFloaterBuyCurrencyHTML(const LLSD& key); ~LLFloaterBuyCurrencyHTML(); bool postBuild() override; + void onClose(bool app_quitting) override; + void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) override; + void navigateToFinalURL(); void setShortfall(S32 shortfall) { mShortfall = shortfall; } -- cgit v1.3 From 069f87c6874f87714f10ec759e01db9817cbcc28 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 14 Aug 2026 23:16:57 +0300 Subject: Add 501-based feature flag check, probed once at login --- indra/newview/llbuycurrencyhtml.cpp | 40 ++++++++++++++++++++++++++---- indra/newview/llbuycurrencyhtml.h | 5 ++++ indra/newview/llfloaterbuycurrencyhtml.cpp | 24 ++++++++++-------- indra/newview/llfloaterbuycurrencyhtml.h | 1 + indra/newview/llstartup.cpp | 2 ++ 5 files changed, 56 insertions(+), 16 deletions(-) diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index 0ae3b6eb4a..81d9a261af 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -34,6 +34,8 @@ #include "llcommandhandler.h" #include "llviewercontrol.h" #include "llstatusbar.h" +#include "llcorehttputil.h" +#include "llcoros.h" // support for secondlife:///app/buycurrencyhtml/{ACTION}/{NEXT_ACTION}/{RETURN_CODE} SLapps class LLBuyCurrencyHTMLHandler : @@ -86,6 +88,35 @@ public: }; LLBuyCurrencyHTMLHandler gBuyCurrencyHTMLHandler; +bool LLBuyCurrencyHTML::sWebFloaterEnabled = false; + +//////////////////////////////////////////////////////////////////////////////// +// static +static void checkFeatureFlag_coro(std::string check_url) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter = std::make_shared("CheckBuyCurrencyURL", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); + httpOptions->setRetries(0); + + LLSD result = httpAdapter->getAndSuspend(httpRequest, check_url, httpOptions); + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + LLBuyCurrencyHTML::sWebFloaterEnabled = !(status.isHttpStatus() && status.getType() == 501); +} + +// static +void LLBuyCurrencyHTML::checkFeatureFlag() +{ + std::string check_url = LLFloaterBuyCurrencyHTML::buildURL(); + LLCoros::instance().launch("checkFeatureFlag_coro", + [check_url]() { checkFeatureFlag_coro(check_url); }); +} + //////////////////////////////////////////////////////////////////////////////// // static // Opens the legacy XUI based floater or new HTML based one based on @@ -93,16 +124,15 @@ LLBuyCurrencyHTMLHandler gBuyCurrencyHTMLHandler; // the case where the amount is not requested. void LLBuyCurrencyHTML::openCurrencyFloater() { - if ( gSavedSettings.getBOOL( "BuyCurrencyHTML" ) ) + if (gSavedSettings.getBOOL("BuyCurrencyHTML") && sWebFloaterEnabled) { - // HTML version LLBuyCurrencyHTML::showDialog(); } else { // legacy version LLFloaterBuyCurrency::buyCurrency(); - }; + } } //////////////////////////////////////////////////////////////////////////////// @@ -112,7 +142,7 @@ void LLBuyCurrencyHTML::openCurrencyFloater() // the case where the amount and a string to display are requested. void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum ) { - if ( gSavedSettings.getBOOL( "BuyCurrencyHTML" ) ) + if (gSavedSettings.getBOOL("BuyCurrencyHTML") && sWebFloaterEnabled) { LLBuyCurrencyHTML::showDialog(sum - gStatusBar->getBalance()); } @@ -120,7 +150,7 @@ void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum { // legacy version LLFloaterBuyCurrency::buyCurrency( message, sum ); - }; + } } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llbuycurrencyhtml.h b/indra/newview/llbuycurrencyhtml.h index 54ee82159d..2f78199dcb 100644 --- a/indra/newview/llbuycurrencyhtml.h +++ b/indra/newview/llbuycurrencyhtml.h @@ -44,6 +44,11 @@ class LLBuyCurrencyHTML // close (and destroy) the currency floater static void closeDialog(); + + // probe BuyCurrencyPacksURL once at login; clears sWebFloaterEnabled if 501 + static void checkFeatureFlag(); + + static bool sWebFloaterEnabled; }; #endif // LL_LLBUYCURRENCYHTML_H diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index 488bd088c1..cd8e33a04b 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -60,25 +60,27 @@ bool LLFloaterBuyCurrencyHTML::postBuild() return true; } -void LLFloaterBuyCurrencyHTML::navigateToFinalURL() +// static +std::string LLFloaterBuyCurrencyHTML::buildURL(S32 shortfall) { - std::string buy_currency_url = gSavedSettings.getString("BuyCurrencyPacksURL"); - + std::string url = gSavedSettings.getString("BuyCurrencyPacksURL"); LLStringUtil::format_map_t replace; replace["[LANGUAGE]"] = LLUI::getLanguage(); - if (mShortfall > 0) + if (shortfall > 0) { - replace["[SHORTFALL]"] = std::to_string(mShortfall); + replace["[SHORTFALL]"] = std::to_string(shortfall); } - - LLStringUtil::format(buy_currency_url, replace); - - if (mShortfall <= 0) + LLStringUtil::format(url, replace); + if (shortfall <= 0) { - LLStringUtil::replaceString(buy_currency_url, "&shortfall=[SHORTFALL]", ""); + LLStringUtil::replaceString(url, "&shortfall=[SHORTFALL]", ""); } + return url; +} - mBrowser->navigateTo(buy_currency_url, HTTP_CONTENT_TEXT_HTML); +void LLFloaterBuyCurrencyHTML::navigateToFinalURL() +{ + mBrowser->navigateTo(buildURL(mShortfall), HTTP_CONTENT_TEXT_HTML); } void LLFloaterBuyCurrencyHTML::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h index 80e368e607..76c54c5f3b 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.h +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -44,6 +44,7 @@ public: void navigateToFinalURL(); void setShortfall(S32 shortfall) { mShortfall = shortfall; } + static std::string buildURL(S32 shortfall = 0); private: LLMediaCtrl* mBrowser; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3aa2c92590..0bc68b6717 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -207,6 +207,7 @@ #include "llsky.h" #include "llstatview.h" #include "llstatusbar.h" // sendMoneyBalanceRequest(), owns L$ balance +#include "llbuycurrencyhtml.h" #include "llsurface.h" #include "lltexturecache.h" #include "lltexturefetch.h" @@ -1963,6 +1964,7 @@ bool idle_startup() // Get L$ and ownership credit information LL_INFOS() << "Requesting Money Balance" << LL_ENDL; LLStatusBar::sendMoneyBalanceRequest(); + LLBuyCurrencyHTML::checkFeatureFlag(); do_startup_frame(); -- cgit v1.3 From aecad04ca946115097390c2ef24c37da55ca3342 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 17 Aug 2026 21:55:28 +0300 Subject: Add fallback to legacy floater on page load error --- indra/newview/llbuycurrencyhtml.cpp | 5 ++++ indra/newview/llfloaterbuycurrencyhtml.cpp | 44 ++++++++++++++++++++++++++++-- indra/newview/llfloaterbuycurrencyhtml.h | 6 ++++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp index 81d9a261af..9ad068cf7f 100644 --- a/indra/newview/llbuycurrencyhtml.cpp +++ b/indra/newview/llbuycurrencyhtml.cpp @@ -145,6 +145,11 @@ void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum if (gSavedSettings.getBOOL("BuyCurrencyHTML") && sWebFloaterEnabled) { LLBuyCurrencyHTML::showDialog(sum - gStatusBar->getBalance()); + LLFloaterBuyCurrencyHTML* floater = dynamic_cast(LLFloaterReg::getInstance("buy_currency_html")); + if (floater) + { + floater->setFallbackContext(message, sum); + } } else { diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp index cd8e33a04b..55b7c32169 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.cpp +++ b/indra/newview/llfloaterbuycurrencyhtml.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterbuycurrencyhtml.h" +#include "llfloaterbuycurrency.h" #include "llmediactrl.h" #include "llstatusbar.h" #include "llviewercontrol.h" @@ -83,11 +84,48 @@ void LLFloaterBuyCurrencyHTML::navigateToFinalURL() mBrowser->navigateTo(buildURL(mShortfall), HTTP_CONTENT_TEXT_HTML); } +void LLFloaterBuyCurrencyHTML::setFallbackContext(const std::string& message, S32 sum) +{ + mFallbackMessage = message; + mFallbackSum = sum; + mHasFallbackTarget = true; +} + +void LLFloaterBuyCurrencyHTML::fallbackToLegacy() +{ + LL_WARNS() << "Buy Currency HTML page failed to load, falling back to legacy floater" << LL_ENDL; + closeFloater(); + if (mHasFallbackTarget) + { + LLFloaterBuyCurrency::buyCurrency(mFallbackMessage, mFallbackSum); + } + else + { + LLFloaterBuyCurrency::buyCurrency(); + } +} + void LLFloaterBuyCurrencyHTML::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) { - if ((LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event) && - (self->getNavigateURI().find("done=success") != std::string::npos)) + if (LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event) { - LLStatusBar::sendMoneyBalanceRequest(); + if (self->getNavigateURI().find("done=success") != std::string::npos) + { + LLStatusBar::sendMoneyBalanceRequest(); + } + else + { + // HTTP 4xx/5xx: fall back to legacy floater + if (self->getNavigateResultCode() >= 400) + { + fallbackToLegacy(); + } + } + } + else if (event == LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_ERROR_PAGE || + event == LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED_LAUNCH || + event == LLPluginClassMediaOwner::MEDIA_EVENT_PLUGIN_FAILED) + { + fallbackToLegacy(); } } diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h index 76c54c5f3b..4b28cf6967 100644 --- a/indra/newview/llfloaterbuycurrencyhtml.h +++ b/indra/newview/llfloaterbuycurrencyhtml.h @@ -44,10 +44,16 @@ public: void navigateToFinalURL(); void setShortfall(S32 shortfall) { mShortfall = shortfall; } + void setFallbackContext(const std::string& message, S32 sum); static std::string buildURL(S32 shortfall = 0); private: + void fallbackToLegacy(); + LLMediaCtrl* mBrowser; S32 mShortfall{0}; + bool mHasFallbackTarget{false}; + std::string mFallbackMessage; + S32 mFallbackSum{0}; }; -- cgit v1.3