Skip to content
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

App-configurable compatibility options spec: CompatibilityOptions #4966

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codendone
Copy link
Contributor

Spec for app-configurable compatibility options, which can be set via CompatibilityOptions APIs or via project properties.


# Background

_This spec adds a CompatibilityOptions class to control behavior of servicing changes._
Copy link
Member

Choose a reason for hiding this comment

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

RuntimeCompatibilityOptions?

AppConfigurableCompatibility?

(Naming, hard :-()


Apps using Windows App SDK have two choices today: use Windows App SDK as an
automatically-updating framework package or use Windows App SDK in self-contained mode with no
automatic updates. Apps which use the framework package automatically get fixes, which is great,
Copy link
Member

Choose a reason for hiding this comment

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

It's not 'automatic updates' but WHO does the servicing. MSIX packages routinely get serviced by Microsoft and others (whoever gets an update to the PC first) vs self-contained copies are serviced by the app/developer. Apps using non-MSIX technologies may perform automatic updates of their dependencies, but it's entirely dependent on the app developer on when (or even if) to do so.

SUGGESTION: ...in self-contained mode updated only if/when the containing application/publisher decides to update its copy of Windows App SDK.

(or words to that effect)

features which require shared services, such as some Notification features delivered via the
Singleton package.

App-configurable compatibility is intended to prevent these problems, enabling apps to choose to
Copy link
Member

Choose a reason for hiding this comment

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

'App-configurable compatibility' - seems to be the catchy term for this feature. API naming should match?

var compatibilityOptions = new CompatibilityOptions();
compatibilityOptions.PatchMode1 = new WindowsAppRuntimeVersion(1,7,3);
compatibilityOptions.PatchMode2 = new WindowsAppRuntimeVersion(1,8,2);
compatibilityOptions.DisabledChanges.Add(CompatibilityChange.HypotheticalChange);
Copy link
Member

Choose a reason for hiding this comment

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

Is HypotheticalChange an actual thing or it's representative of an actual value? If the latter please use a more real example

```

Note that CompatibilityOptions must be applied early in the process before any other Windows App
SDK APIs are called, or right after initializing the Windows App Runtime.
Copy link
Member

Choose a reason for hiding this comment

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

initializing the Windows App Runtime

What does this mean? When does this occur? There is no WindowsAppRuntimeInitialize() function (intentionally)

Do you mean the bootstrapper APIs? Other APIs?


Apply the set compatibility options to the runtime.

Note that CompatibilityOptions must be applied early in the process before any other Windows App
Copy link
Member

Choose a reason for hiding this comment

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

SUGGESTION: NOTE: `CompatibilityOptions MUST be...

  • Bold the NOTE: prefix instead of conversational english
  • Capitalize MUST, much like IEEE MUST/SHOULD/MAY phrasing (RFC 2119)

to ensure the configuration will no longer change. Calling `Apply` will also lock the
configuration.

If the configuration has already been locked, calling `Apply` will throw an `E_ILLEGAL_STATE_CHANGE`
Copy link
Member

Choose a reason for hiding this comment

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

Is that a way to 'Reset` or 'Unapply' the configuration? OR no, 'till process death do you part?

# API Details

```c# (but really MIDL3)
namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime
Copy link
Member

Choose a reason for hiding this comment

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

Missing API contract

SUGGESTION:

namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime
{
    [contractversion(1)]
    apicontract AppConfigurableCompatibilityContract{};

    /// The set of servicing changes that can be disabled.
    [contract(AppConfigurableCompatibilityContract, 1)]
    enum CompatibilityChange
...

UInt32 Patch;
};

/// This object is used by the app to configure any desired compatibility options
Copy link
Member

Choose a reason for hiding this comment

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

By the "app" or "process"?

Can OOP WinRT servers use this API? Are OOP WinRT servers apps?

SUGGESTION: This object is used by the process...

/// This object is used by the app to configure any desired compatibility options
/// for Windows App Runtime behavior of changes added in servicing updates. This
/// object is only used to set the runtime behavior and can't be used to query the
/// applied options.
Copy link
Member

Choose a reason for hiding this comment

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

Why no query API?

Let me guess: An app specifying this knows what it's doing so it doesn't have to query at runtime.

Question: What are class libraries supposed to do?

Lacking a query API creates issues for library authors. How does a library know current process' behavior? They don't control the process/environment they run in (not the app). Would that amount to...?

[contract(AppConfigurableCompatibilityContract, 1)]
runtimeclass CurrentCompatibilityOptions
{
    static CurrentCompatibilityOptions GetDefault();

    WindowsAppRuntimeVersion EffectiveVersion { get; }

    IVector<CompatibilityChange> DisabledChanges{ get; };
}

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

Successfully merging this pull request may close these issues.

2 participants