-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip custom logging logic when app is shutting down #96
Conversation
This seems like a bit of a hacky solution, i opened up this PR more to start a discussion or get other ideas. The logger needs For |
…sent on next launch)
@lefarchi I tried something else here - not sending on quitting but only persisting. Locally cached events will be sent on next launch which should be okay. |
* update logic for active signer check (#65) * upgrade to thirdweb sdk v4.15.0 (#66) * upgrade to thirdweb sdk v4.15.0 * remove obsolete thirdweb assets * update code to work with new sdk * deprecate ThirdwebManager usage in favour of ThirdwebSDK (#67) * deprecate ThirdwebManager usage in favour of ThirdwebSDK * remove test harness config * remove config assets * break out supported chains to separate var for consistency * gitignore configs * pull supported chains from constants; revert newtonsoft imports --------- Co-authored-by: Alec Ananian <[email protected]> * support desktop target in helika config (#68) * Marco/profile logo (#69) * make header logo scale with image * add public GetProject method * download image from url * remove player prefs --------- Co-authored-by: Alec Ananian <[email protected]> * add abi param to write transaction request * [WIP] Remove Unity API usage from Analytics (#63) * swap UnityWebRequest for HttpClient * remove unity api dependency for analytics * minor var name changes * further renaming * dispatch TKDLogger callbacks from main thread * added additional tracking ui/methods * rudimentary pass at engine api isolation * formatting * tweaks to abstracted engine api * added player prefs to TDKAbstractedEngineApi * implemented local settings for persisted even batches * clarified highPriority condition and failover * only print num persisted batches if there are any * add public FlushCache method * add code for deleting stale batch files (30 days old) - commented * typo * change scripting define to TREASURE_ANALYTICS; add highPriority var to event tracking * use higher-level tasks for analytics cache * flush disc cache on startup * workaround for webgl event tracking - track immediate with no caching * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Add test setup and analytics test (WIP) (#70) * Add test setup and analytics test (WIP) * Allow mocking httpClient for tests + improve analytics test * Test batch events (WIP) * Fix infinite retries when uploading disk event cache * Properly log errors when flushing events. Roll back changes to TDK initializer * Use PostAsync instead of SendAsync * Improve error handling --------- Co-authored-by: lefarchi <[email protected]> * Update dev server URL (#71) * upgrade to Thirdweb SDK v4.16.4; fix session start and social login (#72) * Update dev server URL * Update thirdweb SDK to v4.16.4 * Set smart wallet config defaults (fixes Start User Session) * Properly pass clientId when connecting (fixes socials login) --------- Co-authored-by: Alec Ananian <[email protected]> * update thirdweb version (#73) * Dispaly error message when user dont have internet connection. * Invert internet connection condition for clarity * Run disk flush independently every 60 seconds to ensure there is no overlap * Remove unnecessary Task.Run nesting. Remove redundant FlushDiskCache call. * Add internet connection check to abstracted engine api * Skip disk flush when no internet available * Change tabs to spaces * Avoid unnecessary log when there is no connection * Fix/opt click out error (#76) * Fix issues with email + otp login - Fix object reference error when clicking out of otp screen and connecting again - Fix infinite spinner when submitting otp a second time * Request OTP again if user manually hits disconnect button * Remove unity editor reference from otp submit logic * Use EndUserSession when user disconnects * Suggested changes * fix bridgeworld deposit magic helper (#77) * fix server time url (#78) * fix server time url (#79) * v0.5.0 Prep (#81) * change default logo and game name * bumped version to 0.5.0 * upgrade helika sdk to 0.2.0 * upgrade thirdweb sdk to 4.16.6 * Print a warning when config for a service is missing (#82) --------- Co-authored-by: lefarchi <[email protected]> * comment method decorators for individual config creation (#83) * clear out readme and point to docs portal * Add Magicswap submodule with first 3 endpoints (+ harness test screen) (#85) * Add Magicswap submodule with first 3 endpoints (+ harness test screen) * Move api calls to TDK.API class * Integration tests, logger levels, magicswap tweaks, chain switching improvements (#86) * Add integration test for connect flow * Add loggerLevel and autoInitialize properties to TDKConfig * Fix Magicswap type (priceUSD). Improve error handling on UI * Refactor TDKLogger * Use LogDebug to log event payload. Allow config of different log level for prod * Tweak MagicswapUI responsiveness * Use debug logger in tests. Update integration tests * Skip unnecessarily re-initializing thirdweb sdk when switching to same chain * Tests for IdentityUI * Properly reconnect when switching chains after socials login * Refactor reconnect methods. Expose Reconnect(email) method * Rename methods for clarity * add swap functionality to Magicswap service (#87) * Swap endpoint (WIP) * Add swap method to magicswap module * Misc improvements * Show relevant metadata for magicswap * Remove hardcoded treasure id * Use magic contract address. Clean up TODOs * Use AppSettingsData for project info. Remove references to Project (#88) * Use AppSettingsData for project info. Remove references to Project * rename vars for clarity * Add Edit Settings item under Treasure menu * New JSON shape and unify config files - Merge AppSettingsData into TDKConfig - Merge TDKThirdwebConfig into TDKConfig - Update json parser for new format - Remove LoginSettings config * add nativeTokenLimitPerTransaction parsing from config --------- Co-authored-by: Alec Ananian <[email protected]> * Add API key header to HTTP requests (#89) * add api key handling to tdk config * added x-api-key header additions to darkmatter ingest * add x-api-key header to timekeeper request * fix webgl ref * Add api key to TDK.API requests. Remove api key from timekeeper requests --------- Co-authored-by: lefarchi <[email protected]> * Create classes for TDK config sections so they are grouped in inspector (#90) * Add tdk props to Helika tracking (#91) * add tdk props to helika tracking * track to correct service * upgrade thirdweb sdk to v4.19.0 (#92) * Switch to explicit disable vs enable scripting define for Treasure analytics (#93) * switch to explicit disable vs enable scripting define for treasure analytics * remove TDK_THIRDWEB scripting define usage * bumped tdk version to v1.0.0 * fix chain_id event prop addition for helika * brought in thirdweb sdk 4.20.0 * Change TREASURE_ANALYTICS to !DISABLE_TREASURE_ANALTYICS in test asmdef constraints * bypass kochava error --------- Co-authored-by: lefarchi <[email protected]> * Add magicswap liquidity endpoints (#94) * Implement "add liquidity" in harness - Button to approve treasures for magicswap - Show treasures approval status in label - Pass proper args to AddLiquidity * Properly send backendWallet in magicswap endpoints * Default swapLeftover to true * Magicswap remove liquidity (#95) * Refactor magicswapUI add liquidity for clarity * Set isExactOut to true on test swap * Implement RemoveLiquidity. Add button to approve LP * update session validation logic (#97) * Skip custom logging logic when app is shutting down (#96) * Skip custom logging logic when app is shutting down * Remove unused statements from TDKLogger * added/moved to appIsQuitting in main tdk instance * added appIsQuitting to base service * don't attempt event transmission on app quit (only persist - will be sent on next launch) * lifted analytics flush frequency settings to config * remove connect settings from packager --------- Co-authored-by: Yuri Visser <[email protected]> * changed meta files --------- Co-authored-by: Alec Ananian <[email protected]> Co-authored-by: Marco Zakaria <[email protected]> Co-authored-by: lefarchi <[email protected]> Co-authored-by: lefarchi <[email protected]>
@@ -36,6 +34,10 @@ public static void Log(string message) | |||
} | |||
|
|||
private static void LogByLevel(TDKConfig.LoggerLevelValue loggerLevelValue, string message) { | |||
if (TDK.Instance.appIsQuitting) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is accessing Instance
which would be destroyed by the time the app is quitting, meaning it will create a new instance and add it to the scene like before, causing the extra game object to stay in the scene. I just tried the code in develop and the originally reported issue still happens.
* update logic for active signer check (#65) * upgrade to thirdweb sdk v4.15.0 (#66) * upgrade to thirdweb sdk v4.15.0 * remove obsolete thirdweb assets * update code to work with new sdk * deprecate ThirdwebManager usage in favour of ThirdwebSDK (#67) * deprecate ThirdwebManager usage in favour of ThirdwebSDK * remove test harness config * remove config assets * break out supported chains to separate var for consistency * gitignore configs * pull supported chains from constants; revert newtonsoft imports --------- Co-authored-by: Alec Ananian <[email protected]> * support desktop target in helika config (#68) * Marco/profile logo (#69) * make header logo scale with image * add public GetProject method * download image from url * remove player prefs --------- Co-authored-by: Alec Ananian <[email protected]> * add abi param to write transaction request * [WIP] Remove Unity API usage from Analytics (#63) * swap UnityWebRequest for HttpClient * remove unity api dependency for analytics * minor var name changes * further renaming * dispatch TKDLogger callbacks from main thread * added additional tracking ui/methods * rudimentary pass at engine api isolation * formatting * tweaks to abstracted engine api * added player prefs to TDKAbstractedEngineApi * implemented local settings for persisted even batches * clarified highPriority condition and failover * only print num persisted batches if there are any * add public FlushCache method * add code for deleting stale batch files (30 days old) - commented * typo * change scripting define to TREASURE_ANALYTICS; add highPriority var to event tracking * use higher-level tasks for analytics cache * flush disc cache on startup * workaround for webgl event tracking - track immediate with no caching * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Add test setup and analytics test (WIP) (#70) * Add test setup and analytics test (WIP) * Allow mocking httpClient for tests + improve analytics test * Test batch events (WIP) * Fix infinite retries when uploading disk event cache * Properly log errors when flushing events. Roll back changes to TDK initializer * Use PostAsync instead of SendAsync * Improve error handling --------- Co-authored-by: lefarchi <[email protected]> * Update dev server URL (#71) * upgrade to Thirdweb SDK v4.16.4; fix session start and social login (#72) * Update dev server URL * Update thirdweb SDK to v4.16.4 * Set smart wallet config defaults (fixes Start User Session) * Properly pass clientId when connecting (fixes socials login) --------- Co-authored-by: Alec Ananian <[email protected]> * update thirdweb version (#73) * Dispaly error message when user dont have internet connection. * Invert internet connection condition for clarity * Run disk flush independently every 60 seconds to ensure there is no overlap * Remove unnecessary Task.Run nesting. Remove redundant FlushDiskCache call. * Add internet connection check to abstracted engine api * Skip disk flush when no internet available * Change tabs to spaces * Avoid unnecessary log when there is no connection * Fix/opt click out error (#76) * Fix issues with email + otp login - Fix object reference error when clicking out of otp screen and connecting again - Fix infinite spinner when submitting otp a second time * Request OTP again if user manually hits disconnect button * Remove unity editor reference from otp submit logic * Use EndUserSession when user disconnects * Suggested changes * fix bridgeworld deposit magic helper (#77) * fix server time url (#78) * fix server time url (#79) * v0.5.0 Prep (#81) * change default logo and game name * bumped version to 0.5.0 * upgrade helika sdk to 0.2.0 * upgrade thirdweb sdk to 4.16.6 * Print a warning when config for a service is missing (#82) --------- Co-authored-by: lefarchi <[email protected]> * comment method decorators for individual config creation (#83) * clear out readme and point to docs portal * Add Magicswap submodule with first 3 endpoints (+ harness test screen) (#85) * Add Magicswap submodule with first 3 endpoints (+ harness test screen) * Move api calls to TDK.API class * Integration tests, logger levels, magicswap tweaks, chain switching improvements (#86) * Add integration test for connect flow * Add loggerLevel and autoInitialize properties to TDKConfig * Fix Magicswap type (priceUSD). Improve error handling on UI * Refactor TDKLogger * Use LogDebug to log event payload. Allow config of different log level for prod * Tweak MagicswapUI responsiveness * Use debug logger in tests. Update integration tests * Skip unnecessarily re-initializing thirdweb sdk when switching to same chain * Tests for IdentityUI * Properly reconnect when switching chains after socials login * Refactor reconnect methods. Expose Reconnect(email) method * Rename methods for clarity * add swap functionality to Magicswap service (#87) * Swap endpoint (WIP) * Add swap method to magicswap module * Misc improvements * Show relevant metadata for magicswap * Remove hardcoded treasure id * Use magic contract address. Clean up TODOs * Use AppSettingsData for project info. Remove references to Project (#88) * Use AppSettingsData for project info. Remove references to Project * rename vars for clarity * Add Edit Settings item under Treasure menu * New JSON shape and unify config files - Merge AppSettingsData into TDKConfig - Merge TDKThirdwebConfig into TDKConfig - Update json parser for new format - Remove LoginSettings config * add nativeTokenLimitPerTransaction parsing from config --------- Co-authored-by: Alec Ananian <[email protected]> * Add API key header to HTTP requests (#89) * add api key handling to tdk config * added x-api-key header additions to darkmatter ingest * add x-api-key header to timekeeper request * fix webgl ref * Add api key to TDK.API requests. Remove api key from timekeeper requests --------- Co-authored-by: lefarchi <[email protected]> * Create classes for TDK config sections so they are grouped in inspector (#90) * Add tdk props to Helika tracking (#91) * add tdk props to helika tracking * track to correct service * upgrade thirdweb sdk to v4.19.0 (#92) * Switch to explicit disable vs enable scripting define for Treasure analytics (#93) * switch to explicit disable vs enable scripting define for treasure analytics * remove TDK_THIRDWEB scripting define usage * bumped tdk version to v1.0.0 * fix chain_id event prop addition for helika * brought in thirdweb sdk 4.20.0 * Change TREASURE_ANALYTICS to !DISABLE_TREASURE_ANALTYICS in test asmdef constraints * bypass kochava error --------- Co-authored-by: lefarchi <[email protected]> * Add magicswap liquidity endpoints (#94) * Implement "add liquidity" in harness - Button to approve treasures for magicswap - Show treasures approval status in label - Pass proper args to AddLiquidity * Properly send backendWallet in magicswap endpoints * Default swapLeftover to true * Magicswap remove liquidity (#95) * Refactor magicswapUI add liquidity for clarity * Set isExactOut to true on test swap * Implement RemoveLiquidity. Add button to approve LP * update session validation logic (#97) * Skip custom logging logic when app is shutting down (#96) * Skip custom logging logic when app is shutting down * Remove unused statements from TDKLogger * added/moved to appIsQuitting in main tdk instance * added appIsQuitting to base service * don't attempt event transmission on app quit (only persist - will be sent on next launch) * lifted analytics flush frequency settings to config * remove connect settings from packager --------- Co-authored-by: Yuri Visser <[email protected]> * changed meta files * updated helika sdk to v0.2.1 (#99) * bumped helika sdk version in versions.txt; bumped tdk version to 1.0.1 * Swap out facebook login with discord (#100) * Make AppConfig static. Tweak singleton handling (#101) - Avoid recreating instance of TDK on quit - Explicitly initialize TDKMainThreadDispatcher - Pass isAppQuitting flag from TerminateCacheFlushing * V1 cleanup (#102) * Remove outdated TODO comment * Remove old unit test files * Remove outdated comment * Remove OnEmailOTPVerificationSuccess event * Test tweaks * Catch errors on analytics tracking to avoid disrupting caller flow * Rollback Task.Delay usage * Hide discord login option on webgl * Fix metadata fetching on harness scene for webgl * Remove merge markers. Remove duplicate code in analytics service. Remove old code (#104) * re-added helika props --------- Co-authored-by: Alec Ananian <[email protected]> Co-authored-by: Marco Zakaria <[email protected]> Co-authored-by: lefarchi <[email protected]> Co-authored-by: lefarchi <[email protected]>
* update logic for active signer check (#65) * upgrade to thirdweb sdk v4.15.0 (#66) * upgrade to thirdweb sdk v4.15.0 * remove obsolete thirdweb assets * update code to work with new sdk * deprecate ThirdwebManager usage in favour of ThirdwebSDK (#67) * deprecate ThirdwebManager usage in favour of ThirdwebSDK * remove test harness config * remove config assets * break out supported chains to separate var for consistency * gitignore configs * pull supported chains from constants; revert newtonsoft imports --------- Co-authored-by: Alec Ananian <[email protected]> * support desktop target in helika config (#68) * Marco/profile logo (#69) * make header logo scale with image * add public GetProject method * download image from url * remove player prefs --------- Co-authored-by: Alec Ananian <[email protected]> * add abi param to write transaction request * [WIP] Remove Unity API usage from Analytics (#63) * swap UnityWebRequest for HttpClient * remove unity api dependency for analytics * minor var name changes * further renaming * dispatch TKDLogger callbacks from main thread * added additional tracking ui/methods * rudimentary pass at engine api isolation * formatting * tweaks to abstracted engine api * added player prefs to TDKAbstractedEngineApi * implemented local settings for persisted even batches * clarified highPriority condition and failover * only print num persisted batches if there are any * add public FlushCache method * add code for deleting stale batch files (30 days old) - commented * typo * change scripting define to TREASURE_ANALYTICS; add highPriority var to event tracking * use higher-level tasks for analytics cache * flush disc cache on startup * workaround for webgl event tracking - track immediate with no caching * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Add test setup and analytics test (WIP) (#70) * Add test setup and analytics test (WIP) * Allow mocking httpClient for tests + improve analytics test * Test batch events (WIP) * Fix infinite retries when uploading disk event cache * Properly log errors when flushing events. Roll back changes to TDK initializer * Use PostAsync instead of SendAsync * Improve error handling --------- Co-authored-by: lefarchi <[email protected]> * Update dev server URL (#71) * upgrade to Thirdweb SDK v4.16.4; fix session start and social login (#72) * Update dev server URL * Update thirdweb SDK to v4.16.4 * Set smart wallet config defaults (fixes Start User Session) * Properly pass clientId when connecting (fixes socials login) --------- Co-authored-by: Alec Ananian <[email protected]> * update thirdweb version (#73) * Dispaly error message when user dont have internet connection. * Invert internet connection condition for clarity * Run disk flush independently every 60 seconds to ensure there is no overlap * Remove unnecessary Task.Run nesting. Remove redundant FlushDiskCache call. * Add internet connection check to abstracted engine api * Skip disk flush when no internet available * Change tabs to spaces * Avoid unnecessary log when there is no connection * Fix/opt click out error (#76) * Fix issues with email + otp login - Fix object reference error when clicking out of otp screen and connecting again - Fix infinite spinner when submitting otp a second time * Request OTP again if user manually hits disconnect button * Remove unity editor reference from otp submit logic * Use EndUserSession when user disconnects * Suggested changes * fix bridgeworld deposit magic helper (#77) * fix server time url (#78) * fix server time url (#79) * v0.5.0 Prep (#81) * change default logo and game name * bumped version to 0.5.0 * upgrade helika sdk to 0.2.0 * upgrade thirdweb sdk to 4.16.6 * Print a warning when config for a service is missing (#82) --------- Co-authored-by: lefarchi <[email protected]> * comment method decorators for individual config creation (#83) * clear out readme and point to docs portal * Add Magicswap submodule with first 3 endpoints (+ harness test screen) (#85) * Add Magicswap submodule with first 3 endpoints (+ harness test screen) * Move api calls to TDK.API class * Integration tests, logger levels, magicswap tweaks, chain switching improvements (#86) * Add integration test for connect flow * Add loggerLevel and autoInitialize properties to TDKConfig * Fix Magicswap type (priceUSD). Improve error handling on UI * Refactor TDKLogger * Use LogDebug to log event payload. Allow config of different log level for prod * Tweak MagicswapUI responsiveness * Use debug logger in tests. Update integration tests * Skip unnecessarily re-initializing thirdweb sdk when switching to same chain * Tests for IdentityUI * Properly reconnect when switching chains after socials login * Refactor reconnect methods. Expose Reconnect(email) method * Rename methods for clarity * add swap functionality to Magicswap service (#87) * Swap endpoint (WIP) * Add swap method to magicswap module * Misc improvements * Show relevant metadata for magicswap * Remove hardcoded treasure id * Use magic contract address. Clean up TODOs * Use AppSettingsData for project info. Remove references to Project (#88) * Use AppSettingsData for project info. Remove references to Project * rename vars for clarity * Add Edit Settings item under Treasure menu * New JSON shape and unify config files - Merge AppSettingsData into TDKConfig - Merge TDKThirdwebConfig into TDKConfig - Update json parser for new format - Remove LoginSettings config * add nativeTokenLimitPerTransaction parsing from config --------- Co-authored-by: Alec Ananian <[email protected]> * Add API key header to HTTP requests (#89) * add api key handling to tdk config * added x-api-key header additions to darkmatter ingest * add x-api-key header to timekeeper request * fix webgl ref * Add api key to TDK.API requests. Remove api key from timekeeper requests --------- Co-authored-by: lefarchi <[email protected]> * Create classes for TDK config sections so they are grouped in inspector (#90) * Add tdk props to Helika tracking (#91) * add tdk props to helika tracking * track to correct service * upgrade thirdweb sdk to v4.19.0 (#92) * Switch to explicit disable vs enable scripting define for Treasure analytics (#93) * switch to explicit disable vs enable scripting define for treasure analytics * remove TDK_THIRDWEB scripting define usage * bumped tdk version to v1.0.0 * fix chain_id event prop addition for helika * brought in thirdweb sdk 4.20.0 * Change TREASURE_ANALYTICS to !DISABLE_TREASURE_ANALTYICS in test asmdef constraints * bypass kochava error --------- Co-authored-by: lefarchi <[email protected]> * Add magicswap liquidity endpoints (#94) * Implement "add liquidity" in harness - Button to approve treasures for magicswap - Show treasures approval status in label - Pass proper args to AddLiquidity * Properly send backendWallet in magicswap endpoints * Default swapLeftover to true * Magicswap remove liquidity (#95) * Refactor magicswapUI add liquidity for clarity * Set isExactOut to true on test swap * Implement RemoveLiquidity. Add button to approve LP * update session validation logic (#97) * Skip custom logging logic when app is shutting down (#96) * Skip custom logging logic when app is shutting down * Remove unused statements from TDKLogger * added/moved to appIsQuitting in main tdk instance * added appIsQuitting to base service * don't attempt event transmission on app quit (only persist - will be sent on next launch) * lifted analytics flush frequency settings to config * remove connect settings from packager --------- Co-authored-by: Yuri Visser <[email protected]> * changed meta files * updated helika sdk to v0.2.1 (#99) * bumped helika sdk version in versions.txt; bumped tdk version to 1.0.1 * Swap out facebook login with discord (#100) * Make AppConfig static. Tweak singleton handling (#101) - Avoid recreating instance of TDK on quit - Explicitly initialize TDKMainThreadDispatcher - Pass isAppQuitting flag from TerminateCacheFlushing * V1 cleanup (#102) * Remove outdated TODO comment * Remove old unit test files * Remove outdated comment * Remove OnEmailOTPVerificationSuccess event * Test tweaks * Catch errors on analytics tracking to avoid disrupting caller flow * Rollback Task.Delay usage * Hide discord login option on webgl * Fix metadata fetching on harness scene for webgl * Remove merge markers. Remove duplicate code in analytics service. Remove old code (#104) * re-added helika props * update to latest MagicswapV2Router contract address (#105) * bump to version 1.0.2 --------- Co-authored-by: Alec Ananian <[email protected]> Co-authored-by: Marco Zakaria <[email protected]> Co-authored-by: lefarchi <[email protected]> Co-authored-by: lefarchi <[email protected]>
* update logic for active signer check (#65) * upgrade to thirdweb sdk v4.15.0 (#66) * upgrade to thirdweb sdk v4.15.0 * remove obsolete thirdweb assets * update code to work with new sdk * deprecate ThirdwebManager usage in favour of ThirdwebSDK (#67) * deprecate ThirdwebManager usage in favour of ThirdwebSDK * remove test harness config * remove config assets * break out supported chains to separate var for consistency * gitignore configs * pull supported chains from constants; revert newtonsoft imports --------- Co-authored-by: Alec Ananian <[email protected]> * support desktop target in helika config (#68) * Marco/profile logo (#69) * make header logo scale with image * add public GetProject method * download image from url * remove player prefs --------- Co-authored-by: Alec Ananian <[email protected]> * add abi param to write transaction request * [WIP] Remove Unity API usage from Analytics (#63) * swap UnityWebRequest for HttpClient * remove unity api dependency for analytics * minor var name changes * further renaming * dispatch TKDLogger callbacks from main thread * added additional tracking ui/methods * rudimentary pass at engine api isolation * formatting * tweaks to abstracted engine api * added player prefs to TDKAbstractedEngineApi * implemented local settings for persisted even batches * clarified highPriority condition and failover * only print num persisted batches if there are any * add public FlushCache method * add code for deleting stale batch files (30 days old) - commented * typo * change scripting define to TREASURE_ANALYTICS; add highPriority var to event tracking * use higher-level tasks for analytics cache * flush disc cache on startup * workaround for webgl event tracking - track immediate with no caching * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Update Assets/Treasure/TDK/Runtime/Utils/LocalSettings.cs Co-authored-by: lefarchi <[email protected]> * Add test setup and analytics test (WIP) (#70) * Add test setup and analytics test (WIP) * Allow mocking httpClient for tests + improve analytics test * Test batch events (WIP) * Fix infinite retries when uploading disk event cache * Properly log errors when flushing events. Roll back changes to TDK initializer * Use PostAsync instead of SendAsync * Improve error handling --------- Co-authored-by: lefarchi <[email protected]> * Update dev server URL (#71) * upgrade to Thirdweb SDK v4.16.4; fix session start and social login (#72) * Update dev server URL * Update thirdweb SDK to v4.16.4 * Set smart wallet config defaults (fixes Start User Session) * Properly pass clientId when connecting (fixes socials login) --------- Co-authored-by: Alec Ananian <[email protected]> * update thirdweb version (#73) * Dispaly error message when user dont have internet connection. * Invert internet connection condition for clarity * Run disk flush independently every 60 seconds to ensure there is no overlap * Remove unnecessary Task.Run nesting. Remove redundant FlushDiskCache call. * Add internet connection check to abstracted engine api * Skip disk flush when no internet available * Change tabs to spaces * Avoid unnecessary log when there is no connection * Fix/opt click out error (#76) * Fix issues with email + otp login - Fix object reference error when clicking out of otp screen and connecting again - Fix infinite spinner when submitting otp a second time * Request OTP again if user manually hits disconnect button * Remove unity editor reference from otp submit logic * Use EndUserSession when user disconnects * Suggested changes * fix bridgeworld deposit magic helper (#77) * fix server time url (#78) * fix server time url (#79) * v0.5.0 Prep (#81) * change default logo and game name * bumped version to 0.5.0 * upgrade helika sdk to 0.2.0 * upgrade thirdweb sdk to 4.16.6 * Print a warning when config for a service is missing (#82) --------- Co-authored-by: lefarchi <[email protected]> * comment method decorators for individual config creation (#83) * clear out readme and point to docs portal * Add Magicswap submodule with first 3 endpoints (+ harness test screen) (#85) * Add Magicswap submodule with first 3 endpoints (+ harness test screen) * Move api calls to TDK.API class * Integration tests, logger levels, magicswap tweaks, chain switching improvements (#86) * Add integration test for connect flow * Add loggerLevel and autoInitialize properties to TDKConfig * Fix Magicswap type (priceUSD). Improve error handling on UI * Refactor TDKLogger * Use LogDebug to log event payload. Allow config of different log level for prod * Tweak MagicswapUI responsiveness * Use debug logger in tests. Update integration tests * Skip unnecessarily re-initializing thirdweb sdk when switching to same chain * Tests for IdentityUI * Properly reconnect when switching chains after socials login * Refactor reconnect methods. Expose Reconnect(email) method * Rename methods for clarity * add swap functionality to Magicswap service (#87) * Swap endpoint (WIP) * Add swap method to magicswap module * Misc improvements * Show relevant metadata for magicswap * Remove hardcoded treasure id * Use magic contract address. Clean up TODOs * Use AppSettingsData for project info. Remove references to Project (#88) * Use AppSettingsData for project info. Remove references to Project * rename vars for clarity * Add Edit Settings item under Treasure menu * New JSON shape and unify config files - Merge AppSettingsData into TDKConfig - Merge TDKThirdwebConfig into TDKConfig - Update json parser for new format - Remove LoginSettings config * add nativeTokenLimitPerTransaction parsing from config --------- Co-authored-by: Alec Ananian <[email protected]> * Add API key header to HTTP requests (#89) * add api key handling to tdk config * added x-api-key header additions to darkmatter ingest * add x-api-key header to timekeeper request * fix webgl ref * Add api key to TDK.API requests. Remove api key from timekeeper requests --------- Co-authored-by: lefarchi <[email protected]> * Create classes for TDK config sections so they are grouped in inspector (#90) * Add tdk props to Helika tracking (#91) * add tdk props to helika tracking * track to correct service * upgrade thirdweb sdk to v4.19.0 (#92) * Switch to explicit disable vs enable scripting define for Treasure analytics (#93) * switch to explicit disable vs enable scripting define for treasure analytics * remove TDK_THIRDWEB scripting define usage * bumped tdk version to v1.0.0 * fix chain_id event prop addition for helika * brought in thirdweb sdk 4.20.0 * Change TREASURE_ANALYTICS to !DISABLE_TREASURE_ANALTYICS in test asmdef constraints * bypass kochava error --------- Co-authored-by: lefarchi <[email protected]> * Add magicswap liquidity endpoints (#94) * Implement "add liquidity" in harness - Button to approve treasures for magicswap - Show treasures approval status in label - Pass proper args to AddLiquidity * Properly send backendWallet in magicswap endpoints * Default swapLeftover to true * Magicswap remove liquidity (#95) * Refactor magicswapUI add liquidity for clarity * Set isExactOut to true on test swap * Implement RemoveLiquidity. Add button to approve LP * update session validation logic (#97) * Skip custom logging logic when app is shutting down (#96) * Skip custom logging logic when app is shutting down * Remove unused statements from TDKLogger * added/moved to appIsQuitting in main tdk instance * added appIsQuitting to base service * don't attempt event transmission on app quit (only persist - will be sent on next launch) * lifted analytics flush frequency settings to config * remove connect settings from packager --------- Co-authored-by: Yuri Visser <[email protected]> * changed meta files * updated helika sdk to v0.2.1 (#99) * bumped helika sdk version in versions.txt; bumped tdk version to 1.0.1 * Swap out facebook login with discord (#100) * Make AppConfig static. Tweak singleton handling (#101) - Avoid recreating instance of TDK on quit - Explicitly initialize TDKMainThreadDispatcher - Pass isAppQuitting flag from TerminateCacheFlushing * V1 cleanup (#102) * Remove outdated TODO comment * Remove old unit test files * Remove outdated comment * Remove OnEmailOTPVerificationSuccess event * Test tweaks * Catch errors on analytics tracking to avoid disrupting caller flow * Rollback Task.Delay usage * Hide discord login option on webgl * Fix metadata fetching on harness scene for webgl * Remove merge markers. Remove duplicate code in analytics service. Remove old code (#104) * re-added helika props * update to latest MagicswapV2Router contract address (#105) * bump to version 1.0.2 * add api util for sending raw transactions (#107) * add api util for sending raw transactions * move transaction buttons to their own row * Thirdweb v5 (#109) * import thirdweb v5.0.0 * ThirdwebClient initialization in TDKThirdwebService (WIP) * Thirdweb changes on import * Several tweaks to work with v5 - Make GetChainId sync instead of reading from wallet - Make several methods that used GetChainId to be sync - Replace references to ThirdwebService.SDK - Update auth User.Signer typings - Update ConfirmLoginModal to handle new OTP flow - Delete TDKEmbeddedWalletUI.cs (commented out for now) - Update TDK.Connect.cs to use new Thirdweb api - Move wallet logic from TDK.Connect.cs to TDKThirdwebService * add ecosystemId and ecosystemPartnerId to config * Change InAppWallet to EcosystemWallet * Remove unused _lastWalletOptions prop * Delete legacy TDKEmbeddedWalletUI script * Improve handling of connection cancellation * Reimplement silent reconnection * Update wording * Updates after develop merge * upgraded thirdweb sdk to v5.1.0 * Fetch admin metadata on Identity.GetActiveSigners * Resolve several TODOs * Fetch activeSigners and allAdmins in parallel * Add flag to start user session after switching chain * bumped tdk version to 2.0.0 * Use treasure launcher token for identity when available (#110) * Use treasure launcher token for identity when available - When using the launcher prevent connecting, disconnecting, switching chains and ending session - Add function to start user session via local launcher api - Hide disconnect button from account modal when using launcher - Get wallet address from jwt if session not available * Add x socials login (#111) * Update thirdweb to 5.1.1 (fixes android build) * Social login with X (WIP) * Update project settings to match thirdweb SDK specs * Lowercase bundleId * Show all social login options in webgl * Bump Thirdweb SDK to 5.2.1 * Set webgl template to unity default * upgrade to thirdweb v5.2.2 (#112) --------- Co-authored-by: Yuri Visser <[email protected]> --------- Co-authored-by: Yuri Visser <[email protected]> Co-authored-by: Yuri Visser <[email protected]> * remove factory address from config; use address from constants (#113) * add options to WaitForTransaction (#115) * add options to WaitForTransaction * update to wait on initial try * remove bridgeworld functionality (#114) * clean up exposed interfaces; add helpers for common contract reads (#116) * Thirdweb v5.4.0 (#118) * update thirdweb sdk to 5.4.0 * google dep manager bump output * thirdwebclient create no longer takes headers * Helika removal (#119) * remove tdk helika service * remove helika sdk; move AsyncAwaitUtil * remove straggler WalletConenctUnity * update packager * remove legacy WebGLTemplates/Thirdweb * Remove remaining helika references * Fix tests * Simplify app start event --------- Co-authored-by: lefarchi <[email protected]> * Unitypackage release workflow [ENG-580] (#117) * Workflow test * Remove conflict markers from meta file * Finalize workflow * Remove unnecessary thirdweb webgl template * Update release workflow to select specified folders * Hardcode commit hash for 3rd party github actions * Add csc.rsp to release * remove helika, add treasure plugins (for unitypackage action) * change release artifact file name --------- Co-authored-by: Alec Ananian <[email protected]> Co-authored-by: Marco Zakaria <[email protected]> Co-authored-by: lefarchi <[email protected]> Co-authored-by: lefarchi <[email protected]>
Reported by Shep in this slack thread
Context:
TDK.Instance
andTDKMainThreadDispatcher.Instance
.TDKLogger.LogByLevel
TDKLogger.LogByLevel
referencesTDK.Instance
andTDKMainThreadDispatcher.Instance
to work, which are both already being unloaded (null), and in turn tries to create them again, which seems to cause those two objects to appear and stay in the scene hierarchy even after exiting play mode.