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

Updated Android sdk to v10.0.0 Catnip #357

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

novalisdenahi
Copy link
Contributor

Description

Update the Android SDK docs for v10.0.0 (Catnip)

Trello card

Trello ticket

Notes for QA

The SDK docs updated and the config-v2-sdk-support-table.md

Requirement checklist

  • I have validated my changes on a test/local environment.
  • I have checked the SNYK/Dependabot reports and applied the suggested changes.
  • (Optional) I have updated outdated packages.

@novalisdenahi novalisdenahi requested review from sigewuzhere and a team as code owners January 17, 2024 22:08
sigewuzhere
sigewuzhere previously approved these changes Jan 18, 2024
Copy link
Contributor

@adams85 adams85 left a comment

Choose a reason for hiding this comment

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

Could you also adapt and add...

  • this part to the getValue section:
    <div id="setting-type-mapping"></div>
    | Setting Kind | Type parameter `T` |
    | -------------- | --------------------------------- |
    | On/Off Toggle | `bool` / `bool?` |
    | Text | `string` / `string?` |
    | Whole Number | `int` / `int?` / `long` / `long?` |
    | Decimal Number | `double` / `double?` |
    In addition to the types mentioned above, you also have the option to provide `object` or `object?` for the type parameter regardless of the setting kind.
    However, this approach is not recommended as it may involve [boxing](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/boxing-and-unboxing).
    It's important to note that providing any other type for the type parameter will result in an `ArgumentException`.
    If you specify an allowed type but it mismatches the setting kind, an error message will be logged and `defaultValue` will be returned.
    When relying on type inference and not explicitly specifying the type parameter, be mindful of potential type mismatch issues, especially with number types.
    For example, `client.GetValue("keyOfMyDecimalSetting", 0)` will return `defaultValue` (`0`) instead of the actual value of the decimal setting because
    the compiler infers the type as `int` instead of `double`, that is, the call is equivalent to `client.GetValue<int>("keyOfMyDecimalSetting", 0)`,
    which is a type mismatch.
    To correctly evaluate a decimal setting, you should use:
    ```csharp
    var value = client.GetValue("keyOfMyDecimalSetting", 0.0);
    // -or-
    var value = client.GetValue("keyOfMyDecimalSetting", 0d);
    // -or-
    var value = client.GetValue<double>("keyOfMyDecimalSetting", 0);
    ```
  • this part to the getValueDetails section:
    :::caution
    It is important to provide an argument for the `defaultValue` parameter, specifically for the `T` generic type parameter,
    that matches the type of the feature flag or setting you are evaluating. Please refer to [this table](#setting-type-mapping) for the corresponding types.
    :::

Oh, and to the Java SDK docs as well, while we're at it. (Sorry, I forgot to mention this when reviewing the Java SDK PR.)

Copy link

cloudflare-workers-and-pages bot commented Jan 29, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c17124a
Status: ✅  Deploy successful!
Preview URL: https://d6e63cdd.docs-xmy.pages.dev
Branch Preview URL: https://android-sdk-v10-catnip-updat.docs-xmy.pages.dev

View logs

adams85
adams85 previously approved these changes Jan 29, 2024
z4kn4fein
z4kn4fein previously approved these changes Jan 29, 2024
@novalisdenahi novalisdenahi dismissed stale reviews from z4kn4fein and adams85 via c17124a January 30, 2024 10:26
@novalisdenahi novalisdenahi merged commit b1c64c4 into master Jan 30, 2024
3 checks passed
@novalisdenahi novalisdenahi deleted the android-sdk-v10-catnip-update branch January 30, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants