From 551bed71e83576fddd2bd8e40c08fc086c369942 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Thu, 21 Jan 2016 07:42:26 -0800 Subject: [PATCH 1/5] Fixing a null reference exception. --- Baconit/ContentPanels/ContentPanelMaster.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Baconit/ContentPanels/ContentPanelMaster.cs b/Baconit/ContentPanels/ContentPanelMaster.cs index 571534b..8983009 100644 --- a/Baconit/ContentPanels/ContentPanelMaster.cs +++ b/Baconit/ContentPanels/ContentPanelMaster.cs @@ -624,7 +624,6 @@ public async void UnRegisterForPanel(IContentPanelHost host, string panelId) } IContentPanelHost restoreHost = null; - string restoreHostId = null; // Now actually clear the host lock (m_currentPanelList) @@ -645,9 +644,6 @@ public async void UnRegisterForPanel(IContentPanelHost host, string panelId) // Get the host restoreHost = element.PastHosts[0]; element.PastHosts.RemoveAt(0); - - // Get the ID - restoreHostId = element.Source.Id; } // If we the state isn't allowed and we don't have a host to restore @@ -659,9 +655,9 @@ public async void UnRegisterForPanel(IContentPanelHost host, string panelId) } // If we have a panel to restore call register on it. - if(restoreHost != null && !String.IsNullOrWhiteSpace(restoreHostId)) + if(restoreHost != null) { - RegisterForPanel(restoreHost, restoreHostId); + RegisterForPanel(restoreHost, panelId); } } From 6f276d3b545c7170ec8ad9b12fb0bb6fd41870d1 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Thu, 21 Jan 2016 18:19:04 -0800 Subject: [PATCH 2/5] Adding HockeyApp SDK to try to debug crashes. --- BaconBackend/project.json | 1 + BaconBackground/project.json | 1 + Baconit/App.xaml.cs | 9 +++++++++ Baconit/Package.appxmanifest | 2 +- Baconit/project.json | 3 ++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/BaconBackend/project.json b/BaconBackend/project.json index f06a23c..61c85ac 100644 --- a/BaconBackend/project.json +++ b/BaconBackend/project.json @@ -1,5 +1,6 @@ { "dependencies": { + "HockeySDK.WINRT": "2.2.2", "Microsoft.ApplicationInsights": "1.2.3", "Microsoft.ApplicationInsights.PersistenceChannel": "1.2.3", "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", diff --git a/BaconBackground/project.json b/BaconBackground/project.json index b8b2fc9..c618170 100644 --- a/BaconBackground/project.json +++ b/BaconBackground/project.json @@ -1,5 +1,6 @@ { "dependencies": { + "HockeySDK.WINRT": "2.2.2", "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" }, diff --git a/Baconit/App.xaml.cs b/Baconit/App.xaml.cs index f1670b7..c78789d 100644 --- a/Baconit/App.xaml.cs +++ b/Baconit/App.xaml.cs @@ -1,11 +1,13 @@ using BaconBackend; using Baconit.Interfaces; +using HockeyApp; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; +using System.Threading.Tasks; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; @@ -65,6 +67,7 @@ public App() Microsoft.ApplicationInsights.WindowsCollectors.Metadata | Microsoft.ApplicationInsights.WindowsCollectors.UnhandledException | Microsoft.ApplicationInsights.WindowsCollectors.Session); + HockeyClient.Current.Configure("e5847d68bf5e4eb29d96141bc7bde423"); // Init the app this.InitializeComponent(); @@ -192,6 +195,12 @@ private void SetupAndALaunchApp(string arguments) // Ensure the current window is active Window.Current.Activate(); + + // Up load any crash reports if we have them. + Task.Run(async () => + { + await HockeyClient.Current.SendCrashesAsync(true); + }); } /// diff --git a/Baconit/Package.appxmanifest b/Baconit/Package.appxmanifest index 300a1bf..b2b118b 100644 --- a/Baconit/Package.appxmanifest +++ b/Baconit/Package.appxmanifest @@ -1,6 +1,6 @@  - + Baconit diff --git a/Baconit/project.json b/Baconit/project.json index 9e44b3d..77a74be 100644 --- a/Baconit/project.json +++ b/Baconit/project.json @@ -1,11 +1,12 @@ { "dependencies": { + "HockeySDK.WINRT": "2.2.2", "Microsoft.ApplicationInsights": "1.2.3", "Microsoft.ApplicationInsights.PersistenceChannel": "1.2.3", "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", "Microsoft.Band": "1.3.11121", "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0", - "MyToolkit.Extended": "2.5.9" + "MyToolkit.Extended": "2.5.10" }, "frameworks": { "uap10.0": {} From 38de4484b5bb9dfecbac9384e4b5fae6f1a170fe Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Fri, 22 Jan 2016 07:17:37 -0800 Subject: [PATCH 3/5] Reverting the HockeyApp intergration. It doesn't seem to be working and just adds overhead. --- BaconBackend/project.json | 1 - BaconBackground/project.json | 1 - Baconit/App.xaml.cs | 9 --------- Baconit/project.json | 3 +-- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/BaconBackend/project.json b/BaconBackend/project.json index 61c85ac..f06a23c 100644 --- a/BaconBackend/project.json +++ b/BaconBackend/project.json @@ -1,6 +1,5 @@ { "dependencies": { - "HockeySDK.WINRT": "2.2.2", "Microsoft.ApplicationInsights": "1.2.3", "Microsoft.ApplicationInsights.PersistenceChannel": "1.2.3", "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", diff --git a/BaconBackground/project.json b/BaconBackground/project.json index c618170..b8b2fc9 100644 --- a/BaconBackground/project.json +++ b/BaconBackground/project.json @@ -1,6 +1,5 @@ { "dependencies": { - "HockeySDK.WINRT": "2.2.2", "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0" }, diff --git a/Baconit/App.xaml.cs b/Baconit/App.xaml.cs index c78789d..f1670b7 100644 --- a/Baconit/App.xaml.cs +++ b/Baconit/App.xaml.cs @@ -1,13 +1,11 @@ using BaconBackend; using Baconit.Interfaces; -using HockeyApp; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; -using System.Threading.Tasks; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; @@ -67,7 +65,6 @@ public App() Microsoft.ApplicationInsights.WindowsCollectors.Metadata | Microsoft.ApplicationInsights.WindowsCollectors.UnhandledException | Microsoft.ApplicationInsights.WindowsCollectors.Session); - HockeyClient.Current.Configure("e5847d68bf5e4eb29d96141bc7bde423"); // Init the app this.InitializeComponent(); @@ -195,12 +192,6 @@ private void SetupAndALaunchApp(string arguments) // Ensure the current window is active Window.Current.Activate(); - - // Up load any crash reports if we have them. - Task.Run(async () => - { - await HockeyClient.Current.SendCrashesAsync(true); - }); } /// diff --git a/Baconit/project.json b/Baconit/project.json index 77a74be..9e44b3d 100644 --- a/Baconit/project.json +++ b/Baconit/project.json @@ -1,12 +1,11 @@ { "dependencies": { - "HockeySDK.WINRT": "2.2.2", "Microsoft.ApplicationInsights": "1.2.3", "Microsoft.ApplicationInsights.PersistenceChannel": "1.2.3", "Microsoft.ApplicationInsights.WindowsApps": "1.1.1", "Microsoft.Band": "1.3.11121", "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0", - "MyToolkit.Extended": "2.5.10" + "MyToolkit.Extended": "2.5.9" }, "frameworks": { "uap10.0": {} From 86d16358dd88f81756758fc07bec90438a2b5592 Mon Sep 17 00:00:00 2001 From: Quinn Damerell Date: Mon, 25 Jan 2016 09:33:46 -0800 Subject: [PATCH 4/5] Working around a crash in the full screen logic. --- BaconBackend/Collectors/CommentCollector.cs | 4 +- BaconBackend/Collectors/MessageCollector.cs | 2 +- BaconBackend/Collectors/PostCollector.cs | 4 +- BaconBackend/Helpers/MiscellaneousHelper.cs | 18 +- .../Helpers/TrendingSubredditsHelper.cs | 4 +- .../Background/BackgroundBandManager.cs | 6 +- .../Background/BackgroundImageUpdater.cs | 10 +- .../Background/BackgroundMessageUpdater.cs | 2 +- .../Background/MessageOfTheDayManager.cs | 2 +- BaconBackend/Managers/BackgroundManager.cs | 2 +- BaconBackend/Managers/DraftManager.cs | 4 +- BaconBackend/Managers/ImageManager.cs | 4 +- BaconBackend/Managers/MemoryManager.cs | 4 +- BaconBackend/Managers/MessageManager.cs | 4 +- BaconBackend/Managers/SettingsManager.cs | 2 +- BaconBackend/Managers/SubredditManager.cs | 6 +- BaconBackend/Managers/TelemetryManager.cs | 2 +- BaconBackend/Managers/UserManager.cs | 2 +- Baconit/ContentPanels/ContentPanelMaster.cs | 10 +- .../Panels/BasicImageContentPanel.xaml.cs | 4 +- .../ContentPanels/Panels/ContentPanelBase.cs | 4 +- .../Panels/GifImageContentPanel.xaml.cs | 6 +- .../Panels/MarkdownContentPanel.xaml.cs | 2 +- .../Panels/RedditContentPanel.xaml.cs | 2 +- .../Panels/WebPageContentPanel.xaml.cs | 4 +- .../Panels/YoutubeContentPanel.xaml.cs | 2 +- Baconit/HelperControls/CommentBox.xaml.cs | 2 +- Baconit/HelperControls/MotdPopUp.xaml.cs | 2 +- Baconit/MainPage.xaml.cs | 2 +- Baconit/Package.appxmanifest | 16 +- Baconit/PanelManager.xaml.cs | 2 +- Baconit/Panels/FlipView/FlipViewPanel.xaml.cs | 4 +- .../FlipView/FlipViewPostCommentManager.cs | 2 +- .../Panels/FlipView/FlipViewPostPanel.xaml.cs | 176 ++++++++++-------- Baconit/Panels/LoginPanel.xaml.cs | 2 +- Baconit/Panels/MessageInbox.xaml.cs | 2 +- 36 files changed, 176 insertions(+), 150 deletions(-) diff --git a/BaconBackend/Collectors/CommentCollector.cs b/BaconBackend/Collectors/CommentCollector.cs index 5fb69eb..a0d7010 100644 --- a/BaconBackend/Collectors/CommentCollector.cs +++ b/BaconBackend/Collectors/CommentCollector.cs @@ -450,7 +450,7 @@ public bool CommentAddedOrEdited(string parentOrOrgionalId, string serverRespons { // We fucked up adding the comment to the UI. m_baconMan.MessageMan.DebugDia("Failed injecting comment", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "AddCommentSuccessButAddUiFailed"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "AddCommentSuccessButAddUiFailed"); } // If we get to adding to the UI return true because reddit has the comment. @@ -460,7 +460,7 @@ public bool CommentAddedOrEdited(string parentOrOrgionalId, string serverRespons { // Reddit returned something wrong m_baconMan.MessageMan.ShowMessageSimple("That's not right", "Sorry we can't post your comment right now, reddit returned and unexpected message."); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "CommentPostReturnedUnexpectedMessage"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "CommentPostReturnedUnexpectedMessage"); return false; } } diff --git a/BaconBackend/Collectors/MessageCollector.cs b/BaconBackend/Collectors/MessageCollector.cs index fe267bd..55f6226 100644 --- a/BaconBackend/Collectors/MessageCollector.cs +++ b/BaconBackend/Collectors/MessageCollector.cs @@ -110,7 +110,7 @@ public void ChangeMessageReadStatus(Message message, bool isRead, int messagePos catch (Exception ex) { m_baconMan.MessageMan.DebugDia("failed to set message status!", ex); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failedToSetMessageRead", ex); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failedToSetMessageRead", ex); } }); } diff --git a/BaconBackend/Collectors/PostCollector.cs b/BaconBackend/Collectors/PostCollector.cs index 6f8454d..3c75ef2 100644 --- a/BaconBackend/Collectors/PostCollector.cs +++ b/BaconBackend/Collectors/PostCollector.cs @@ -460,7 +460,7 @@ public bool EditSelfPost(Post post, string serverResponse) { // We fucked up updating the UI for the post edit. m_baconMan.MessageMan.DebugDia("Failed updating selftext in UI", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedUpdatingSelftextInUI"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedUpdatingSelftextInUI"); } // If the response was ok always return true. @@ -470,7 +470,7 @@ public bool EditSelfPost(Post post, string serverResponse) { // Reddit returned something wrong m_baconMan.MessageMan.ShowMessageSimple("That's not right", "We can't edit your post right now, reddit returned and unexpected message."); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "CommentPostReturnedUnexpectedMessage"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "CommentPostReturnedUnexpectedMessage"); return false; } } diff --git a/BaconBackend/Helpers/MiscellaneousHelper.cs b/BaconBackend/Helpers/MiscellaneousHelper.cs index b7d442a..9c5a563 100644 --- a/BaconBackend/Helpers/MiscellaneousHelper.cs +++ b/BaconBackend/Helpers/MiscellaneousHelper.cs @@ -182,7 +182,7 @@ public static async Task SendRedditComment(BaconManager baconMan, string } catch (Exception e) { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to send comment", e); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to send comment", e); baconMan.MessageMan.DebugDia("failed to send message", e); } return returnString; @@ -215,7 +215,7 @@ public static async Task GetRedditUser(BaconManager baconMan, string userN } catch (Exception e) { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to search for user", e); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to search for user", e); baconMan.MessageMan.DebugDia("failed to search for user", e); } return foundUser; @@ -246,7 +246,7 @@ public static async Task DeletePost(BaconManager baconMan, string postId) } catch (Exception e) { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to delete post", e); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to delete post", e); baconMan.MessageMan.DebugDia("failed to delete post", e); } return false; @@ -294,13 +294,13 @@ public static async Task SaveOrHideRedditItem(BaconManager baconMan, strin } else { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to save or hide item, unknown response"); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to save or hide item, unknown response"); baconMan.MessageMan.DebugDia("failed to save or hide item, unknown response"); } } catch (Exception e) { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to save or hide item", e); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to save or hide item", e); baconMan.MessageMan.DebugDia("failed to save or hide item", e); } return wasSuccess; @@ -368,20 +368,20 @@ public static async Task SubmitNewPost(BaconManager bacon string enumName = Enum.GetName(typeof(SubmitNewPostErrors), i).ToLower(); ; if (responseLower.Contains(enumName)) { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to submit post; error: "+ enumName); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to submit post; error: "+ enumName); baconMan.MessageMan.DebugDia("failed to submit post; error: "+ enumName); return new SubmitNewPostResponse() { Success = false, RedditError = (SubmitNewPostErrors)i}; } } - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to submit post; unknown reddit error: "); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to submit post; unknown reddit error: "); baconMan.MessageMan.DebugDia("failed to submit post; unknown reddit error"); return new SubmitNewPostResponse() { Success = false, RedditError = SubmitNewPostErrors.UNKNOWN }; } } catch (Exception e) { - baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to submit post", e); + baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to submit post", e); baconMan.MessageMan.DebugDia("failed to submit post", e); return new SubmitNewPostResponse() { Success = false }; } @@ -411,7 +411,7 @@ public static string UploadImageToImgur(BaconManager baconMan, FileRandomAccessS //} //catch (Exception e) //{ - // baconMan.TelemetryMan.ReportUnExpectedEvent("MisHelper", "failed to submit post", e); + // baconMan.TelemetryMan.ReportUnexpectedEvent("MisHelper", "failed to submit post", e); // baconMan.MessageMan.DebugDia("failed to submit post", e); // return new SubmitNewPostResponse() { Success = false }; //} diff --git a/BaconBackend/Helpers/TrendingSubredditsHelper.cs b/BaconBackend/Helpers/TrendingSubredditsHelper.cs index 7c6c565..8d736d8 100644 --- a/BaconBackend/Helpers/TrendingSubredditsHelper.cs +++ b/BaconBackend/Helpers/TrendingSubredditsHelper.cs @@ -140,7 +140,7 @@ private void Collector_OnCollectionUpdated(object sender, OnCollectionUpdatedArg } catch(Exception ex) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failedtoParseTrendingPost", ex); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failedtoParseTrendingPost", ex); m_baconMan.MessageMan.DebugDia("failed to parse trending subs post", ex); } } @@ -167,7 +167,7 @@ private void FireReadyEvent(List newSubreddits) } catch(Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failedToFireReadyEvent", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failedToFireReadyEvent", e); m_baconMan.MessageMan.DebugDia("failed to fire trending subs ready event", e); } } diff --git a/BaconBackend/Managers/Background/BackgroundBandManager.cs b/BaconBackend/Managers/Background/BackgroundBandManager.cs index e5f1401..d19695b 100644 --- a/BaconBackend/Managers/Background/BackgroundBandManager.cs +++ b/BaconBackend/Managers/Background/BackgroundBandManager.cs @@ -115,7 +115,7 @@ public async Task UpdateInboxMessages(List> newNot catch(Exception e) { m_baconMan.MessageMan.DebugDia("failed to update band message", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToUpdateBandMessages", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToUpdateBandMessages", e); } } } @@ -188,7 +188,7 @@ public async Task EnsureBandTileState() if (!await bandClient.TileManager.AddTileAsync(tile)) { m_baconMan.MessageMan.DebugDia("failed to create tile"); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToCreateTileOnBand"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToCreateTileOnBand"); wasSuccess = false; } } @@ -203,7 +203,7 @@ public async Task EnsureBandTileState() if (!await bandClient.TileManager.RemoveTileAsync(baconitTile)) { m_baconMan.MessageMan.DebugDia("failed to remove tile"); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToRemoveTileOnBand"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToRemoveTileOnBand"); wasSuccess = false; } } diff --git a/BaconBackend/Managers/Background/BackgroundImageUpdater.cs b/BaconBackend/Managers/Background/BackgroundImageUpdater.cs index bdeb046..216b31f 100644 --- a/BaconBackend/Managers/Background/BackgroundImageUpdater.cs +++ b/BaconBackend/Managers/Background/BackgroundImageUpdater.cs @@ -172,7 +172,7 @@ private async Task KickOffUpdate(bool force, RefCountedDeferral refDeferral) catch(Exception e) { m_baconMan.MessageMan.DebugDia("Failed to set background image", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "Failed to set background image", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "Failed to set background image", e); } } @@ -216,7 +216,7 @@ private async Task DoImageRotation(UpdateTypes type) catch (Exception e) { m_baconMan.MessageMan.DebugDia("Failed to set background image", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "Failed to set background image", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "Failed to set background image", e); } } @@ -286,7 +286,7 @@ private async Task DoSingleImageRotation(UpdateTypes type) if (!wasSuccess) { m_baconMan.TelemetryMan.ReportLog(this, "Image update failed", SeverityLevel.Error); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, type == UpdateTypes.LockScreen ? "LockscreenImageUpdateFailed" : "DesktopImageUpdateFailed"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, type == UpdateTypes.LockScreen ? "LockscreenImageUpdateFailed" : "DesktopImageUpdateFailed"); } else { @@ -460,7 +460,7 @@ private async void GetImagesFromPosts(List posts, UpdateTypes type) } catch(Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToDeleteCacheImages", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToDeleteCacheImages", e); } // Setup the vars @@ -583,7 +583,7 @@ public async void OnRequestComplete(object sender, ImageManager.ImageManagerResp catch (Exception e) { m_baconMan.MessageMan.DebugDia("Failed to write background image", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "Failed to write background image", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "Failed to write background image", e); } } diff --git a/BaconBackend/Managers/Background/BackgroundMessageUpdater.cs b/BaconBackend/Managers/Background/BackgroundMessageUpdater.cs index c3777e4..3c34c3c 100644 --- a/BaconBackend/Managers/Background/BackgroundMessageUpdater.cs +++ b/BaconBackend/Managers/Background/BackgroundMessageUpdater.cs @@ -232,7 +232,7 @@ public async void UpdateNotifications(List newMessages) } catch (Exception ex) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "messageUpdaterFailed", ex); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "messageUpdaterFailed", ex); m_baconMan.MessageMan.DebugDia("failed to update message notifications", ex); } diff --git a/BaconBackend/Managers/Background/MessageOfTheDayManager.cs b/BaconBackend/Managers/Background/MessageOfTheDayManager.cs index 20e14de..f3311de 100644 --- a/BaconBackend/Managers/Background/MessageOfTheDayManager.cs +++ b/BaconBackend/Managers/Background/MessageOfTheDayManager.cs @@ -121,7 +121,7 @@ public async Task GetNewMessage() catch(Exception e) { m_baconMan.MessageMan.DebugDia("failed to get motd", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToGetMotd", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToGetMotd", e); } return null; diff --git a/BaconBackend/Managers/BackgroundManager.cs b/BaconBackend/Managers/BackgroundManager.cs index ae1aea7..f14585e 100644 --- a/BaconBackend/Managers/BackgroundManager.cs +++ b/BaconBackend/Managers/BackgroundManager.cs @@ -99,7 +99,7 @@ public async Task EnsureBackgroundSetup() } catch(Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failed to register background task", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failed to register background task", e); m_baconMan.MessageMan.DebugDia("failed to register background task", e); } } diff --git a/BaconBackend/Managers/DraftManager.cs b/BaconBackend/Managers/DraftManager.cs index e566132..7d1084e 100644 --- a/BaconBackend/Managers/DraftManager.cs +++ b/BaconBackend/Managers/DraftManager.cs @@ -65,7 +65,7 @@ public async Task SavePostSubmissionDraft(PostSubmissionDraftData data) catch(Exception e) { m_baconMan.MessageMan.DebugDia("failed to write draft", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToWriteDraftFile",e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToWriteDraftFile",e); return false; } return true; @@ -98,7 +98,7 @@ public async Task GetPostSubmissionDraft() catch (Exception e) { m_baconMan.MessageMan.DebugDia("failed to read draft", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToReadDraftFile", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToReadDraftFile", e); return null; } } diff --git a/BaconBackend/Managers/ImageManager.cs b/BaconBackend/Managers/ImageManager.cs index cde9638..a033ff4 100644 --- a/BaconBackend/Managers/ImageManager.cs +++ b/BaconBackend/Managers/ImageManager.cs @@ -321,7 +321,7 @@ public void SaveImageLocally(string postUrl) } catch(Exception ex) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToSaveImageLocallyCallback", ex); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToSaveImageLocallyCallback", ex); m_baconMan.MessageMan.DebugDia("failed to save image locally in callback", ex); } }; @@ -329,7 +329,7 @@ public void SaveImageLocally(string postUrl) } catch (Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToSaveImageLocally", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToSaveImageLocally", e); m_baconMan.MessageMan.DebugDia("failed to save image locally", e); } } diff --git a/BaconBackend/Managers/MemoryManager.cs b/BaconBackend/Managers/MemoryManager.cs index 30c77f5..492eaab 100644 --- a/BaconBackend/Managers/MemoryManager.cs +++ b/BaconBackend/Managers/MemoryManager.cs @@ -285,7 +285,7 @@ public void FireMemoryReport(ulong usedMemory, ulong memoryLimit, double usedPer catch(Exception e) { m_baconMan.MessageMan.DebugDia("Memory report fire failed", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "MemeoryReportFiredFailed", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "MemeoryReportFiredFailed", e); } } @@ -309,7 +309,7 @@ public void FireMemoryCleanup(MemoryPressureStates current, MemoryPressureStates catch (Exception e) { m_baconMan.MessageMan.DebugDia("Memory cleanup fire failed", e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "MemeoryCleanupFiredFailed", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "MemeoryCleanupFiredFailed", e); } } } diff --git a/BaconBackend/Managers/MessageManager.cs b/BaconBackend/Managers/MessageManager.cs index ccaf68a..2d66139 100644 --- a/BaconBackend/Managers/MessageManager.cs +++ b/BaconBackend/Managers/MessageManager.cs @@ -37,7 +37,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch } catch (Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToShowMessage", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToShowMessage", e); } }); } @@ -83,7 +83,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch } catch(Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToShowMessage",e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToShowMessage",e); } }); } diff --git a/BaconBackend/Managers/SettingsManager.cs b/BaconBackend/Managers/SettingsManager.cs index 9e77be6..4df1568 100644 --- a/BaconBackend/Managers/SettingsManager.cs +++ b/BaconBackend/Managers/SettingsManager.cs @@ -86,7 +86,7 @@ public void WriteToLocalSettings(string name, T obj) catch(Exception e) { m_baconMan.MessageMan.DebugDia("failed to write setting " + name, e); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failedToWriteSetting" + name, e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failedToWriteSetting" + name, e); } } diff --git a/BaconBackend/Managers/SubredditManager.cs b/BaconBackend/Managers/SubredditManager.cs index 404509b..8a10377 100644 --- a/BaconBackend/Managers/SubredditManager.cs +++ b/BaconBackend/Managers/SubredditManager.cs @@ -191,7 +191,7 @@ public async Task GetSubredditFromWebByDisplayName(string displayName } catch (Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failed to get subreddit", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failed to get subreddit", e); m_baconMan.MessageMan.DebugDia("failed to get subreddit", e); } @@ -257,13 +257,13 @@ public async Task ChangeSubscriptionStatus(string subredditId, bool subscr } // Report the error - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToSubscribeToSubredditWebRequestFailed"); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToSubscribeToSubredditWebRequestFailed"); m_baconMan.MessageMan.DebugDia("failed to subscribe / unsub subreddit, reddit returned an expected value"); return false; } catch (Exception e) { - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToSubscribeToSubreddit", e); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToSubscribeToSubreddit", e); m_baconMan.MessageMan.DebugDia("failed to subscribe / unsub subreddit", e); } return false; diff --git a/BaconBackend/Managers/TelemetryManager.cs b/BaconBackend/Managers/TelemetryManager.cs index 4d25a0f..7c32d1c 100644 --- a/BaconBackend/Managers/TelemetryManager.cs +++ b/BaconBackend/Managers/TelemetryManager.cs @@ -38,7 +38,7 @@ public void ReportEvent(object component, string eventName, string data) /// Reports an event that might need to be looked at, an unexpected event. /// /// - public void ReportUnExpectedEvent(object component, string eventName, Exception excpetion = null) + public void ReportUnexpectedEvent(object component, string eventName, Exception excpetion = null) { TelemetryClient client = new TelemetryClient(); EventTelemetry eventT = new EventTelemetry(); diff --git a/BaconBackend/Managers/UserManager.cs b/BaconBackend/Managers/UserManager.cs index 490fcdc..c4a444c 100644 --- a/BaconBackend/Managers/UserManager.cs +++ b/BaconBackend/Managers/UserManager.cs @@ -168,7 +168,7 @@ private void FireOnUserUpdated(UserCallbackAction action) catch (Exception ex) { m_baconMan.MessageMan.DebugDia("Failed to notify user listener of update", ex); - m_baconMan.TelemetryMan.ReportUnExpectedEvent(this, "failed to fire OnUserUpdated", ex); + m_baconMan.TelemetryMan.ReportUnexpectedEvent(this, "failed to fire OnUserUpdated", ex); } } diff --git a/Baconit/ContentPanels/ContentPanelMaster.cs b/Baconit/ContentPanels/ContentPanelMaster.cs index 8983009..a599e52 100644 --- a/Baconit/ContentPanels/ContentPanelMaster.cs +++ b/Baconit/ContentPanels/ContentPanelMaster.cs @@ -982,7 +982,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch catch (Exception e) { App.BaconMan.MessageMan.DebugDia("FireOnPanelAvailable failed", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FireOnPanelAvailableFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FireOnPanelAvailableFailed", e); } }); } @@ -1007,7 +1007,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch catch (Exception e) { App.BaconMan.MessageMan.DebugDia("FireOnRemovePanel failed", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FireOnRemovePanelFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FireOnRemovePanelFailed", e); } }); } @@ -1028,7 +1028,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch catch (Exception e) { App.BaconMan.MessageMan.DebugDia("FireOnRemovePanel failed", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FireOnRemovePanelFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FireOnRemovePanelFailed", e); } }); } @@ -1051,7 +1051,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch catch (Exception e) { App.BaconMan.MessageMan.DebugDia("FireOnContentPreloading failed", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FireOnContentPreloadingFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FireOnContentPreloadingFailed", e); } }); } @@ -1073,7 +1073,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio catch (Exception e) { App.BaconMan.MessageMan.DebugDia("FireOnPanelUnloaded failed", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FireOnPanelUnloadedFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FireOnPanelUnloadedFailed", e); } }); } diff --git a/Baconit/ContentPanels/Panels/BasicImageContentPanel.xaml.cs b/Baconit/ContentPanels/Panels/BasicImageContentPanel.xaml.cs index 984cc6d..de9171d 100644 --- a/Baconit/ContentPanels/Panels/BasicImageContentPanel.xaml.cs +++ b/Baconit/ContentPanels/Panels/BasicImageContentPanel.xaml.cs @@ -153,7 +153,7 @@ public void OnPrepareContent() if (String.IsNullOrWhiteSpace(imageUrl)) { // This is bad, we should be able to get the url. - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "BasicImageControlNoImageUrl"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "BasicImageControlNoImageUrl"); // Jump back to the UI thread m_base.FireOnFallbackToBrowser(); @@ -254,7 +254,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch { if (!response.Success) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "BasicImageControlNoImageUrl"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "BasicImageControlNoImageUrl"); m_base.FireOnFallbackToBrowser(); return; } diff --git a/Baconit/ContentPanels/Panels/ContentPanelBase.cs b/Baconit/ContentPanels/Panels/ContentPanelBase.cs index 7d52bb2..f17c7ee 100644 --- a/Baconit/ContentPanels/Panels/ContentPanelBase.cs +++ b/Baconit/ContentPanels/Panels/ContentPanelBase.cs @@ -313,7 +313,7 @@ public async Task CreateContentPanel(ContentPanelSource source, bool canLo { // If we fail here we will fall back to the web browser. App.BaconMan.MessageMan.DebugDia("Failed to query can handle post", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToQueryCanHandlePost", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToQueryCanHandlePost", e); } } @@ -336,7 +336,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio loadedPanel = false; HasError = true; App.BaconMan.MessageMan.DebugDia("failed to create content control", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToCreateContentPanel", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToCreateContentPanel", e); } }); } diff --git a/Baconit/ContentPanels/Panels/GifImageContentPanel.xaml.cs b/Baconit/ContentPanels/Panels/GifImageContentPanel.xaml.cs index f37bf5a..33fb69a 100644 --- a/Baconit/ContentPanels/Panels/GifImageContentPanel.xaml.cs +++ b/Baconit/ContentPanels/Panels/GifImageContentPanel.xaml.cs @@ -105,7 +105,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch if (String.IsNullOrWhiteSpace(gifUrl)) { m_base.FireOnFallbackToBrowser(); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToShowGifAfterConfirm"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToShowGifAfterConfirm"); return; } @@ -382,7 +382,7 @@ private async Task GetGfyCatGifUrl(string apiUrl) catch (Exception e) { App.BaconMan.MessageMan.DebugDia("failed to get image from gfycat", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FaileGfyCatApiCall", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FaileGfyCatApiCall", e); } return String.Empty; @@ -441,7 +441,7 @@ private async Task ConvertGifUsingGfycat(string gifUrl) catch (Exception e) { App.BaconMan.MessageMan.DebugDia("failed to convert gif via gfycat", e); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "GfyCatConvertFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "GfyCatConvertFailed", e); } return String.Empty; diff --git a/Baconit/ContentPanels/Panels/MarkdownContentPanel.xaml.cs b/Baconit/ContentPanels/Panels/MarkdownContentPanel.xaml.cs index e5a5893..ceaed71 100644 --- a/Baconit/ContentPanels/Panels/MarkdownContentPanel.xaml.cs +++ b/Baconit/ContentPanels/Panels/MarkdownContentPanel.xaml.cs @@ -136,7 +136,7 @@ private void MarkdownBox_OnMarkdownReady(object sender, OnMarkdownReadyArgs e) if (e.WasError) { m_base.FireOnFallbackToBrowser(); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToShowMarkdown", e.Exception); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToShowMarkdown", e.Exception); } else { diff --git a/Baconit/ContentPanels/Panels/RedditContentPanel.xaml.cs b/Baconit/ContentPanels/Panels/RedditContentPanel.xaml.cs index c028bc4..b60fc1b 100644 --- a/Baconit/ContentPanels/Panels/RedditContentPanel.xaml.cs +++ b/Baconit/ContentPanels/Panels/RedditContentPanel.xaml.cs @@ -123,7 +123,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio case RedditContentType.Website: // This shouldn't happen App.BaconMan.MessageMan.DebugDia("Got website back when prepare on reddit content control"); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "GotWebsiteOnPrepareRedditContent"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "GotWebsiteOnPrepareRedditContent"); break; } } diff --git a/Baconit/ContentPanels/Panels/WebPageContentPanel.xaml.cs b/Baconit/ContentPanels/Panels/WebPageContentPanel.xaml.cs index 95f1161..8835feb 100644 --- a/Baconit/ContentPanels/Panels/WebPageContentPanel.xaml.cs +++ b/Baconit/ContentPanels/Panels/WebPageContentPanel.xaml.cs @@ -141,7 +141,7 @@ private void MakeWebView() } catch (Exception e) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToMakeUriInWebControl", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToMakeUriInWebControl", e); m_base.FireOnError(true, "This web page failed to load"); } @@ -225,7 +225,7 @@ private void ReadingMode_Tapped(object sender, TappedRoutedEventArgs e) } catch (Exception ex) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToNavReadingMode", ex); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToNavReadingMode", ex); } App.BaconMan.TelemetryMan.ReportEvent(this, "ReadingModeEnabled"); diff --git a/Baconit/ContentPanels/Panels/YoutubeContentPanel.xaml.cs b/Baconit/ContentPanels/Panels/YoutubeContentPanel.xaml.cs index 38f5d59..7210436 100644 --- a/Baconit/ContentPanels/Panels/YoutubeContentPanel.xaml.cs +++ b/Baconit/ContentPanels/Panels/YoutubeContentPanel.xaml.cs @@ -94,7 +94,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch { // If we failed fallback to the browser. m_base.FireOnFallbackToBrowser(); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToGetYoutubeVideoAfterSuccess"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToGetYoutubeVideoAfterSuccess"); return; } diff --git a/Baconit/HelperControls/CommentBox.xaml.cs b/Baconit/HelperControls/CommentBox.xaml.cs index 53fafe5..a682bc5 100644 --- a/Baconit/HelperControls/CommentBox.xaml.cs +++ b/Baconit/HelperControls/CommentBox.xaml.cs @@ -375,7 +375,7 @@ private async void Send_Click(object sender, RoutedEventArgs e) catch (Exception ex) { App.BaconMan.MessageMan.DebugDia("failed to fire OnCommentSubmitted", ex); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "OnCommentSubmittedFireFailed", ex); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "OnCommentSubmittedFireFailed", ex); } } else diff --git a/Baconit/HelperControls/MotdPopUp.xaml.cs b/Baconit/HelperControls/MotdPopUp.xaml.cs index fd367e7..0b73b52 100644 --- a/Baconit/HelperControls/MotdPopUp.xaml.cs +++ b/Baconit/HelperControls/MotdPopUp.xaml.cs @@ -112,7 +112,7 @@ private void MarkdownText_OnMarkdownLinkTapped(object sender, UniversalMarkdown. } catch (Exception ex) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "MOTDLinkFailedToOpen", ex); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "MOTDLinkFailedToOpen", ex); App.BaconMan.MessageMan.DebugDia("MOTDLinkFailedToOpen", ex); } } diff --git a/Baconit/MainPage.xaml.cs b/Baconit/MainPage.xaml.cs index 7ea4ac2..7f9888e 100644 --- a/Baconit/MainPage.xaml.cs +++ b/Baconit/MainPage.xaml.cs @@ -352,7 +352,7 @@ private void UpdateSubredditList(List newSubreddits) } catch(Exception e) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "UpdateSubredditListFailed", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "UpdateSubredditListFailed", e); App.BaconMan.MessageMan.DebugDia("UpdateSubredditListFailed", e); } } diff --git a/Baconit/Package.appxmanifest b/Baconit/Package.appxmanifest index b2b118b..72d31fe 100644 --- a/Baconit/Package.appxmanifest +++ b/Baconit/Package.appxmanifest @@ -1,6 +1,6 @@  - + Baconit @@ -27,23 +27,23 @@ + + + + + - + Assets\AppAssets\Square44x44\Square44.png Baconit - + Assets\AppAssets\Square44x44\Square44.png Baconit - - - - - diff --git a/Baconit/PanelManager.xaml.cs b/Baconit/PanelManager.xaml.cs index 85356f5..78bf06f 100644 --- a/Baconit/PanelManager.xaml.cs +++ b/Baconit/PanelManager.xaml.cs @@ -1014,7 +1014,7 @@ private async void MemoryMan_OnMemoryCleanUpRequest(object sender, BaconBackend. // Check that we are good. if (currentPanel == null) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "MemoryCleanupCurrentPanelNull"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "MemoryCleanupCurrentPanelNull"); return; } diff --git a/Baconit/Panels/FlipView/FlipViewPanel.xaml.cs b/Baconit/Panels/FlipView/FlipViewPanel.xaml.cs index 0ebfcb5..5c06b0b 100644 --- a/Baconit/Panels/FlipView/FlipViewPanel.xaml.cs +++ b/Baconit/Panels/FlipView/FlipViewPanel.xaml.cs @@ -443,7 +443,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch } catch (Exception e) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "mPostListAddFailedSpot1", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "mPostListAddFailedSpot1", e); App.BaconMan.MessageMan.DebugDia("Adding to m_postList failed! " + (post == null ? "post was null!" : "post IS NOT NULL"), e); } } @@ -462,7 +462,7 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch } catch(Exception e) { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "mPostListAddFailedSpot2", e); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "mPostListAddFailedSpot2", e); App.BaconMan.MessageMan.DebugDia("Adding to m_postList failed! " + (post == null ? "post was null!" : "post IS NOT NULL"), e); } } diff --git a/Baconit/Panels/FlipView/FlipViewPostCommentManager.cs b/Baconit/Panels/FlipView/FlipViewPostCommentManager.cs index 0eb3ebd..263bd02 100644 --- a/Baconit/Panels/FlipView/FlipViewPostCommentManager.cs +++ b/Baconit/Panels/FlipView/FlipViewPostCommentManager.cs @@ -631,7 +631,7 @@ private void DataTransferManager_DataRequested(DataTransferManager sender, DataR else { args.Request.FailWithDisplayText("Baconit doesn't have anything to share!"); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToShareCommentHelperCommentNoShareComment"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToShareCommentHelperCommentNoShareComment"); } } diff --git a/Baconit/Panels/FlipView/FlipViewPostPanel.xaml.cs b/Baconit/Panels/FlipView/FlipViewPostPanel.xaml.cs index 6ab0fac..39e8af4 100644 --- a/Baconit/Panels/FlipView/FlipViewPostPanel.xaml.cs +++ b/Baconit/Panels/FlipView/FlipViewPostPanel.xaml.cs @@ -432,7 +432,7 @@ private void DataTransferManager_DataRequested(DataTransferManager sender, DataR else { args.Request.FailWithDisplayText("Baconit doesn't have anything to share!"); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "FailedToShareFilpViewPostNoSharePost"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "FailedToShareFilpViewPostNoSharePost"); } } @@ -1054,12 +1054,13 @@ private void ToggleFullscreen(bool goFullscreen, bool force = false) } // Make sure the user hasn't overwritten this. - if(m_fullScreenOverwrite.HasValue) + bool? localOverwriteValue = m_fullScreenOverwrite; + if (localOverwriteValue.HasValue) { // If we are being force and the overwrite isn't from the user skip this. - if(!force || (m_isfullScreenOverwriteUser.HasValue && !m_isfullScreenOverwriteUser.Value)) + if(!force || (localOverwriteValue.HasValue && !localOverwriteValue.Value)) { - if (m_fullScreenOverwrite.Value != goFullscreen) + if (localOverwriteValue.Value != goFullscreen) { return; } @@ -1067,81 +1068,106 @@ private void ToggleFullscreen(bool goFullscreen, bool force = false) } m_isFullscreen = goFullscreen; - if (IsVisible) + string traceString = ""; + try { - // Get our elements for the sticky header - Storyboard storyboard = (Storyboard)m_stickyHeader.FindName("ui_storyCollapseHeader"); - DoubleAnimation animBody = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderBodyTranslate"); - DoubleAnimation animTitle = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderTitleTranslate"); - DoubleAnimation animSubtext = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderSubtextTranslate"); - DoubleAnimation animIcons = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderIconsTranslate"); - DoubleAnimation animFullscreenButton = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderFullscreenButtonRotate"); - Grid stickyGrid = (Grid)m_stickyHeader.FindName("ui_storyHeaderBlock"); - - // Stop any past animations. - if (storyboard.GetCurrentState() != ClockState.Stopped) + if (IsVisible) { - storyboard.Stop(); - } - - // Setup the animations. - double animTo = goFullscreen ? -stickyGrid.ActualHeight : 0; - double animFrom = goFullscreen ? 0 : -stickyGrid.ActualHeight; - animBody.To = animTo; - animBody.From = animFrom; - animTitle.To = animTo; - animTitle.From = animFrom; - animSubtext.To = animTo; - animSubtext.From = animFrom; - animIcons.To = animTo; - animIcons.From = animFrom; - animFullscreenButton.To = goFullscreen ? 0 : 180; - animFullscreenButton.From = goFullscreen ? 180 : 0; - - // For the normal header - Storyboard storyNormal = (Storyboard)m_storyHeader.FindName("ui_storyCollapseHeaderHeight"); - Grid headerGrid = (Grid)m_storyHeader.FindName("ui_storyHeaderBlock"); - DoubleAnimation animNormal = (DoubleAnimation)m_storyHeader.FindName("ui_animHeaderHeightCollapse"); - DoubleAnimation animNormalFullscreenButton = (DoubleAnimation)m_storyHeader.FindName("ui_animHeaderHeightButtonRotate"); + // Get our elements for the sticky header + Storyboard storyboard = (Storyboard)m_stickyHeader.FindName("ui_storyCollapseHeader"); + DoubleAnimation animBody = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderBodyTranslate"); + DoubleAnimation animTitle = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderTitleTranslate"); + DoubleAnimation animSubtext = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderSubtextTranslate"); + DoubleAnimation animIcons = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderIconsTranslate"); + DoubleAnimation animFullscreenButton = (DoubleAnimation)m_stickyHeader.FindName("ui_animHeaderFullscreenButtonRotate"); + Grid stickyGrid = (Grid)m_stickyHeader.FindName("ui_storyHeaderBlock"); + + traceString += " gotstickelement "; + + // Stop any past animations. + if (storyboard.GetCurrentState() != ClockState.Stopped) + { + storyboard.Stop(); + } - // Stop any past animations. - if (storyNormal.GetCurrentState() != ClockState.Stopped) - { - storyNormal.Stop(); - } + traceString += $" settingStickAnim height [{stickyGrid.ActualHeight}[ "; + + // Setup the animations. + double animTo = goFullscreen ? -stickyGrid.ActualHeight : 0; + double animFrom = goFullscreen ? 0 : -stickyGrid.ActualHeight; + animBody.To = animTo; + animBody.From = animFrom; + animTitle.To = animTo; + animTitle.From = animFrom; + animSubtext.To = animTo; + animSubtext.From = animFrom; + animIcons.To = animTo; + animIcons.From = animFrom; + animFullscreenButton.To = goFullscreen ? 0 : 180; + animFullscreenButton.From = goFullscreen ? 180 : 0; + + traceString += " gettingnormalHeader "; + + // For the normal header + Storyboard storyNormal = (Storyboard)m_storyHeader.FindName("ui_storyCollapseHeaderHeight"); + Grid headerGrid = (Grid)m_storyHeader.FindName("ui_storyHeaderBlock"); + DoubleAnimation animNormal = (DoubleAnimation)m_storyHeader.FindName("ui_animHeaderHeightCollapse"); + DoubleAnimation animNormalFullscreenButton = (DoubleAnimation)m_storyHeader.FindName("ui_animHeaderHeightButtonRotate"); + + traceString += " stoppingclock "; + + // Stop any past animations. + if (storyNormal.GetCurrentState() != ClockState.Stopped) + { + storyNormal.Stop(); + } - // Set the normal animations. - animNormal.To = goFullscreen ? 0 : headerGrid.ActualHeight; - animNormal.From = goFullscreen ? headerGrid.ActualHeight : 0; - animNormalFullscreenButton.To = goFullscreen ? 0 : 180; - animNormalFullscreenButton.From = goFullscreen ? 180 : 0; + traceString += " settingnormalheaders "; - // Play the animations. - storyboard.Begin(); - storyNormal.Begin(); - } - else - { - // If not visible, just reset the UI. + // Set the normal animations. + animNormal.To = goFullscreen ? 0 : headerGrid.ActualHeight; + animNormal.From = goFullscreen ? headerGrid.ActualHeight : 0; + animNormalFullscreenButton.To = goFullscreen ? 0 : 180; + animNormalFullscreenButton.From = goFullscreen ? 180 : 0; - // For the normal header set the size and the button - Grid headerGrid = (Grid)m_storyHeader.FindName("ui_storyHeaderBlock"); - RotateTransform headerFullscreenButtonRotate = (RotateTransform)m_storyHeader.FindName("ui_headerFullscreenButtonRotate"); - headerFullscreenButtonRotate.Angle = goFullscreen ? 0 : 180; - headerGrid.MaxHeight = goFullscreen ? double.NaN : headerGrid.ActualHeight; + traceString += " play "; - // For the sticky header reset the transforms. - TranslateTransform titleTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerTitleTransform"); - TranslateTransform subtextTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerSubtextTransform"); - TranslateTransform iconTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerIconsTransform"); - TranslateTransform bodyTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerBodyTransform"); - Grid stickyGrid = (Grid)m_stickyHeader.FindName("ui_storyHeaderBlock"); - double setTo = goFullscreen ? -stickyGrid.ActualHeight : 0; - titleTrans.Y = setTo; - subtextTrans.Y = setTo; - iconTrans.Y = setTo; - bodyTrans.Y = setTo; + // Play the animations. + storyboard.Begin(); + storyNormal.Begin(); + } + else + { + // If not visible, just reset the UI. + + traceString += " gettingElements "; + + // For the normal header set the size and the button + Grid headerGrid = (Grid)m_storyHeader.FindName("ui_storyHeaderBlock"); + RotateTransform headerFullscreenButtonRotate = (RotateTransform)m_storyHeader.FindName("ui_headerFullscreenButtonRotate"); + headerFullscreenButtonRotate.Angle = goFullscreen ? 0 : 180; + headerGrid.MaxHeight = goFullscreen ? double.NaN : headerGrid.ActualHeight; + + traceString += $" SettingElements height[{headerGrid.ActualHeight}] "; + + // For the sticky header reset the transforms. + TranslateTransform titleTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerTitleTransform"); + TranslateTransform subtextTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerSubtextTransform"); + TranslateTransform iconTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerIconsTransform"); + TranslateTransform bodyTrans = (TranslateTransform)m_storyHeader.FindName("ui_headerBodyTransform"); + Grid stickyGrid = (Grid)m_stickyHeader.FindName("ui_storyHeaderBlock"); + double setTo = goFullscreen ? -stickyGrid.ActualHeight : 0; + titleTrans.Y = setTo; + subtextTrans.Y = setTo; + iconTrans.Y = setTo; + bodyTrans.Y = setTo; + } + } + catch(Exception e) + { + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, $"FullscreenToggleFailed IsVis:{IsVisible}, gofull:{goFullscreen}, trace string [{traceString}]", e); + App.BaconMan.MessageMan.DebugDia($"FullscreenToggleFailed IsVis:{IsVisible}, gofull:{goFullscreen}, trace string [{traceString}]", e); } } @@ -1452,13 +1478,13 @@ private bool CommentBox_OnCommentSubmitted(object sender, OnCommentSubmittedArgs } else { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "CommentSubmitManagerObjNull"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "CommentSubmitManagerObjNull"); } } } else { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "CommentSubmitPostObjNull"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "CommentSubmitPostObjNull"); } } else if (e.RedditId.StartsWith("t1_")) @@ -1474,12 +1500,12 @@ private bool CommentBox_OnCommentSubmitted(object sender, OnCommentSubmittedArgs } else { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "CommentSubmitManagerObjNull"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "CommentSubmitManagerObjNull"); } } else { - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "CommentSubmitCommentObjNull"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "CommentSubmitCommentObjNull"); } } diff --git a/Baconit/Panels/LoginPanel.xaml.cs b/Baconit/Panels/LoginPanel.xaml.cs index 46bf159..b59a85b 100644 --- a/Baconit/Panels/LoginPanel.xaml.cs +++ b/Baconit/Panels/LoginPanel.xaml.cs @@ -117,7 +117,7 @@ private async void LoginButton_Click(object sender, RoutedEventArgs e) else { App.BaconMan.MessageMan.ShowMessageSimple("Something Went Wrong", "We can't log you in right now, try again later."); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "LoginFailedUnknown"); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "LoginFailedUnknown"); } } } diff --git a/Baconit/Panels/MessageInbox.xaml.cs b/Baconit/Panels/MessageInbox.xaml.cs index 95a7517..983480b 100644 --- a/Baconit/Panels/MessageInbox.xaml.cs +++ b/Baconit/Panels/MessageInbox.xaml.cs @@ -250,7 +250,7 @@ private void ViewContext_OnButtonTapped(object sender, EventArgs e) { App.BaconMan.MessageMan.DebugDia("failed to parse message context", ex); App.BaconMan.MessageMan.ShowMessageSimple("Oops", "Something is wrong and we can't show this context right now."); - App.BaconMan.TelemetryMan.ReportUnExpectedEvent(this, "failedToParseMessageContextString", ex); + App.BaconMan.TelemetryMan.ReportUnexpectedEvent(this, "failedToParseMessageContextString", ex); return; } From 2fc8e0afdd928f4ec8cea23ff319d6f552a431c8 Mon Sep 17 00:00:00 2001 From: Connor Uhlman Date: Wed, 27 Jan 2016 21:25:24 -0600 Subject: [PATCH 5/5] Fix for Issue #57 --- Baconit/MainPage.xaml.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Baconit/MainPage.xaml.cs b/Baconit/MainPage.xaml.cs index 7ea4ac2..253c5ae 100644 --- a/Baconit/MainPage.xaml.cs +++ b/Baconit/MainPage.xaml.cs @@ -162,10 +162,15 @@ private void MainPage_Loaded(object sender, RoutedEventArgs e) defaultDisplayName = m_subredditFirstNavOverwrite; } + SortTypes defaultSortType = App.BaconMan.UiSettingsMan.SubredditList_DefaultSortType; + SortTimeTypes defaultSortTime = App.BaconMan.UiSettingsMan.SubredditList_DefaultSortTimeType; + // Navigate to the start Dictionary args = new Dictionary(); args.Add(PanelManager.NAV_ARGS_SUBREDDIT_NAME, defaultDisplayName); - m_panelManager.Navigate(typeof(SubredditPanel), defaultDisplayName + SortTypes.Hot + SortTimeTypes.Week, args); + args.Add(PanelManager.NAV_ARGS_SUBREDDIT_SORT, defaultSortType); + args.Add(PanelManager.NAV_ARGS_SUBREDDIT_SORT_TIME, defaultSortTime); + m_panelManager.Navigate(typeof(SubredditPanel), defaultDisplayName + defaultSortType + defaultSortTime, args); m_panelManager.Navigate(typeof(WelcomePanel), "WelcomePanel"); // Update the trending subreddits @@ -826,9 +831,15 @@ private void QuickSearchHiPriGrid_Tapped(object sender, TappedRoutedEventArgs e) /// private void NavigateToSubreddit(Subreddit subreddit) { + SortTypes defaultSortType = App.BaconMan.UiSettingsMan.SubredditList_DefaultSortType; + SortTimeTypes defaultSortTime = App.BaconMan.UiSettingsMan.SubredditList_DefaultSortTimeType; + Dictionary args = new Dictionary(); args.Add(PanelManager.NAV_ARGS_SUBREDDIT_NAME, subreddit.DisplayName.ToLower()); - m_panelManager.Navigate(typeof(SubredditPanel), subreddit.GetNavigationUniqueId(SortTypes.Hot, SortTimeTypes.Week), args); + args.Add(PanelManager.NAV_ARGS_SUBREDDIT_SORT, defaultSortType); + args.Add(PanelManager.NAV_ARGS_SUBREDDIT_SORT_TIME, defaultSortTime); + + m_panelManager.Navigate(typeof(SubredditPanel), subreddit.GetNavigationUniqueId(defaultSortType, defaultSortTime), args); } #endregion