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

fix: allow OnConfigureHandlerReturn props to be null [EXT-2869] #858

Merged
merged 1 commit into from Jul 16, 2021

Conversation

andipaetzold
Copy link
Contributor

@andipaetzold andipaetzold commented Jul 13, 2021

We currently get the following error when updating to app sdk v4 in a fresh CCA app

Type 'Promise<{ parameters: AppInstallationParameters; targetState: AppState | null; }>' is not assignable to type 'OnConfigureHandlerReturn'.
  Type 'Promise<{ parameters: AppInstallationParameters; targetState: AppState | null; }>' is not assignable to type 'Promise<{ parameters?: KeyValueMap | undefined; targetState?: AppState | undefined; }>'.
    Type '{ parameters: AppInstallationParameters; targetState: AppState | null; }' is not assignable to type '{ parameters?: KeyValueMap | undefined; targetState?: AppState | undefined; }'.
      Types of property 'targetState' are incompatible.
        Type 'AppState | null' is not assignable to type 'AppState | undefined'.
          Type 'null' is not assignable to type 'AppState | undefined'.  TS2322

    35 |     // invoked when a user attempts to install the app or update
    36 |     // its configuration.
  > 37 |     props.sdk.app.onConfigure(() => onConfigure());
       |                                     ^
    38 |   }, [props.sdk, onConfigure]);
    39 |
    40 |   useEffect(() => {

This PR allows null to be returned for parameters and targetState.

@andipaetzold andipaetzold requested a review from a team as a code owner July 13, 2021 15:56
@andipaetzold andipaetzold changed the base branch from master to canary July 13, 2021 15:59
@andipaetzold andipaetzold self-assigned this Jul 13, 2021
@andipaetzold andipaetzold changed the title fix: allow OnConfigureHandlerReturn props to be null fix: allow OnConfigureHandlerReturn props to be null [EXT-2869] Jul 13, 2021
@andipaetzold andipaetzold requested review from colomolo and Jwhiles and removed request for a team July 15, 2021 10:32
@colomolo
Copy link
Contributor

colomolo commented Jul 15, 2021

Does it relate to previously done class->FC refactoring? Or the error comes from other place?

@andipaetzold
Copy link
Contributor Author

Does it relate to previously done class->FC refactoring? Or the error comes from other place?

@colomolo The error occurs in the class-based and function-based CCA component. This wasn't introduced by our change.

@colomolo
Copy link
Contributor

colomolo commented Jul 15, 2021

@colomolo The error occurs in the class-based and function-based CCA component. This wasn't introduced by our change.

Good, thanks!

@andipaetzold andipaetzold merged commit 0e9b80c into canary Jul 16, 2021
@andipaetzold andipaetzold deleted the onconfigure-type-null branch July 16, 2021 09:48
ghost pushed a commit that referenced this pull request Jul 20, 2021
# [4.0.0-alpha.24](v4.0.0-alpha.23...v4.0.0-alpha.24) (2021-07-20)

### Bug Fixes

* update canary with master ([#870](#870)) ([0f509dd](0f509dd)), closes [#718](#718) [#719](#719) [#715](#715) [#720](#720) [#723](#723) [#721](#721) [#724](#724) [#726](#726) [#729](#729) [#731](#731) [#733](#733) [#728](#728) [#727](#727) [#730](#730) [#732](#732) [#734](#734) [#735](#735) [#738](#738) [#736](#736) [#737](#737) [#740](#740) [#743](#743) [#741](#741) [#742](#742) [#746](#746) [#749](#749) [#748](#748) [#751](#751) [#755](#755) [#757](#757) [#756](#756) [#752](#752) [#754](#754) [#626](#626) [#758](#758) [#759](#759) [#739](#739) [#690](#690) [#687](#687) [#585](#585) [#747](#747) [#760](#760) [#670](#670) [#762](#762) [#763](#763) [#764](#764) [#768](#768)
* **dialogIds:** ignore entity scoped ids from baseSDK ([#863](#863)) ([5f2850b](5f2850b))
* allow parameters and targetState to be null in onConfigure response ([#858](#858)) ([0e9b80c](0e9b80c))
@ghost
Copy link

ghost commented Jul 20, 2021

🎉 This PR is included in version 4.0.0-alpha.24 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released on @canary label Jul 20, 2021
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.

None yet

2 participants