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

Improving lifecycle callbacks in order to reduce conviva errors: Invalid : Did you report playback ended? #78

Merged
merged 11 commits into from
Aug 28, 2024

Conversation

testcenter
Copy link
Contributor

@testcenter testcenter commented Aug 23, 2024

Conviva showed multiple errors while reporting metrics (mainly during startup / teardown)

  • Update conviva to the latest release
  • Fixed PlayerView livecycle callbacks
  • remove reportAppForegrounded and reportAppBackgrounded as it is handled internally already
  • add endSession call before releasing the conviva sdk

Note:
Conviva still shows an error, when ads are disabled.
This is because we are initializing the ad analytics always. (which will in turn automatically subscribe for activityLifecycleObserver callbacks and tries to report foreground/background although no ad session is running)

}

/**
* This should be called when the app is paused
* <p>
* NOTE: This method must not be called, when the analytics is created via `ConvivaAnalytics.buildVideoAnalytics` or `ConvivaAnalytics.buildAdAnalytics` as this is handled internally already!
Copy link
Contributor

Choose a reason for hiding this comment

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

The constructors for inserting the Conviva video & ad analytics are meant for testing purposes only. Hence I am not sure if this comment makes sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so the constructors that should be used are only following 2?

  • public ConvivaAnalyticsIntegration(Player player, String customerKey, Context context)
  • public ConvivaAnalyticsIntegration(Player player, String customerKey, Context context, ConvivaConfig config)
    what about the constructor with ssai? also for testing only?

in the case the other constructors are for testing only, I would mark them as @VisibleForTesting, to disallow customers the usage of them. (which would allow us to remove the functions again 🤔 )

Copy link
Contributor

Choose a reason for hiding this comment

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

The are removed in #81, still I am not super happy with just removing the functions given that this might be in use by customers.
I would suggest to keep them for now and maybe deprecate them to indicate that they should not be used any more.
Maybe there is still a scenario out there that we are missing where they could be useful. @dweinber or @stonko1994 might know more.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't notice this PR 🙈 -> will update and resolve the merge conflicts tomorrow first thing

ok, I am fine to keep the functions and mark them as deprecated 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there is any value in having those constructors. I looked up the commit where they were introduced (at least the first one): ce87848#diff-4c62961b542a5646de9a27ab30562e6b508b8f3438a8c950a893960b81ee5733.

The commit messages clearly indicates that this was just for testing (mocking/stubbing). I'd take the risk of someone using it and keeping them removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stonko1994 thanks for your input about the constructors.
What do you think about the functions reportAppForegrounded and ...Backgrounded? (these functions shouldn't be called anymore, as this is handled inside the conviva-core sdk and will produce error messages in touchstone when being called by the customer)

@strangesource I updated the comment and marked the functions as deprecated here: 19ad7c3

Copy link
Contributor

Choose a reason for hiding this comment

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

They were definitelly needed in the past and we also mention the need to call them in the readme AFAIK. If they should no longer used I'd deprecate them but I wouldn't throw errors (only log warnings).

Revert convivaAnalyticsIntegration = null
@testcenter testcenter merged commit 7a33060 into develop Aug 28, 2024
3 checks passed
@testcenter testcenter deleted the fix/reporting-lifecycle branch August 28, 2024 09:21
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