Skip to content

[EUCUST-125] Remove duplicate resolve#260

Merged
Apekka merged 3 commits intomainfrom
EUCUST-125
Jul 22, 2025
Merged

[EUCUST-125] Remove duplicate resolve#260
Apekka merged 3 commits intomainfrom
EUCUST-125

Conversation

@Apekka
Copy link
Copy Markdown
Contributor

@Apekka Apekka commented Jul 11, 2025

What do these changes do?

Remove the resolve function call in the feature flag part of the plugin.

Why are these changes necessary?

Following an EU escalation, where the customer had crashes if the app was in airplane mode, it couldn't get the feature flags, and also couldn't catch the exception to avoid the crash.
cf logs :
image
This happened cause we were calling twice result.error (in AirshipPlugin.kt and in Extensions.kt)

How did you verify these changes?

Running in the sample app, with airplane mode and trying to catch the exception of a feature flag, it works properly now we only have logs and the app can still function.

E/AirshipPlugin(30247): Error processing featureFlag#flag
E/AirshipPlugin(30247): com.urbanairship.featureflag.FeatureFlagException$FailedToFetch: Failed to fetch feature flag: 'rad_flag'! Stale data is not allowed.

@Apekka Apekka requested a review from a team as a code owner July 11, 2025 16:34
@ilitvinenko
Copy link
Copy Markdown
Contributor

are we sure we don't won't to report an error on exception? looks a little suspicious :)

@@ -362,7 +362,8 @@ class AirshipPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
try {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should not have a try here, its already handled by the resolve method extension

} catch (e: Exception) {
result.error("ERROR", "Failed to get flag", e.localizedMessage)
if (flagName == null) {
throw Exception("Missing flagName")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: requireNotNull instead

Log.d("AirshipPlugin", "LiveUpdate update method called successfully")
null
} catch (e: Exception) {
Log.e("AirshipPlugin", "Error processing liveUpdate#update request", e)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we log exceptions somewhere else?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It will reject it at the flutter level to let them log it as its a usage error and not a plugin error

@Apekka Apekka merged commit a962ebc into main Jul 22, 2025
3 checks passed
@Apekka Apekka deleted the EUCUST-125 branch July 22, 2025 09:06
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.

3 participants