Skip to content

Push Notifications Long Running Process (LRP) lifetime impl#1186

Merged
loneursid merged 89 commits intomainfrom
WNP_LRP
Oct 13, 2021
Merged

Push Notifications Long Running Process (LRP) lifetime impl#1186
loneursid merged 89 commits intomainfrom
WNP_LRP

Conversation

@danielayala94
Copy link
Copy Markdown
Contributor

@danielayala94 danielayala94 commented Aug 5, 2021

This PR introduces the Push Notifications Long Running Process (LRP), a component that is intended to receive push notifications from unpackaged apps (including those packaged apps where the Windows build doesn't have BI support - see BackgroundTaskBuilder.SetTaskEntryPointClsid(Guid) API).

The scope of this change is limited to implement the lifetime of the LRP. Full push notifications support will be added in subsequent PRs.

The Windows App SDK layer will talk to the LRP through COM. Because of the current limitations on WinRT for OOP COM servers, we use a proxy stub and WRL APIs.

With the current approach, the LRP shuts down 30 seconds after launching. In subsequent PRs, we will add the logic to persist it and maintain the 30-second timer in case the LRP is not needed at the time.

We are also including a Startup Task, which will launch the LRP on user log on.

How tested: Manually triggered startup task and LRP exe, verifying that CreateInstance was called in the case of the startup task. Also verified that LRP shut down after 30 seconds. Included a unit test to verify we were able to CoCreate a LRP instance.

Comment thread test/TestApps/PushNotificationsDemoApp/main.cpp Outdated
@danielayala94 danielayala94 reopened this Aug 5, 2021
@danielayala94 danielayala94 marked this pull request as draft August 5, 2021 23:47
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask.StartupTask/winmain.cpp Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask.StartupTask/winmain.cpp Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask.StartupTask/winmain.cpp Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask/externs.h Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask/platform.cpp Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask/platform.cpp Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask/platform.cpp Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask/platform.h Outdated
Comment thread dev/PushNotifications/PushNotificationsLongRunningTask/winmain.cpp Outdated
@sharath2727
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

* Hack to address AppLifecycle regression introduced in main

* Code cleanup

* Code cleanup

* Addressing PR feedback

* Adding bare bone unit test to avoid future regression

Co-authored-by: Eric Langlois <erlangl@microsoft.com>
@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

* LRP fixes

* In progress

* Revert "In progress"

This reverts commit d5d021a.

* Add fixes to E2E testing

* Address nits

* Added nits from other PR and fixed PushNotificationUtiilty

* Use string converter with payload length

* Update APITests.cpp

* Include AppLifecycle fix for PushArgs

* Revert "Include AppLifecycle fix for PushArgs"

This reverts commit 33994da.

* Addressing nits

* Add Verify.h to demo app for helper function

* Added TAEF dependencies to Demo/TestApp

Co-authored-by: Daniel Ayala <14967941+danielayala94@users.noreply.github.com>
@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Pull request contains merge conflicts.

@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Eric Langlois <erlangl@microsoft.com>
@loneursid
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Contributor

@loneursid loneursid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lifting the block, as the latest FrameworkUDK as been ingested into main

@loneursid loneursid merged commit dbbfb8b into main Oct 13, 2021
@loneursid loneursid deleted the WNP_LRP branch October 13, 2021 14:13
@@ -9,7 +9,8 @@ namespace winrt::Microsoft::Windows::AppLifecycle::implementation
// Registration constant values.
static PCWSTR c_argumentPrefix{ L"----" };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const or constexpr instead of static. statis results in unique copies of the variables in every translation unit that includes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Notifications Toast notification, badges, Live Tiles, push notifications needs-triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add LRP binaries to ProjectReunion

8 participants