-
Notifications
You must be signed in to change notification settings - Fork 11
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 invalid session ID in post roll ad sessions #82
Fix invalid session ID in post roll ad sessions #82
Conversation
DispatchQueue.main.asyncAfter(deadline: .now() + 0.10) { [weak self] in | ||
guard let self else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sneak: fixed missing weak reference
@@ -33,8 +33,8 @@ extension BitmovinPlayerListener: PlayerListener { | |||
// The default SDK error handling is that it triggers the onSourceUnloaded before the onError event. | |||
// To track errors to conviva we need to delay the onSourceUnloaded to ensure the onError event is | |||
// called first. | |||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { | |||
self.delegate?.onSourceUnloaded() | |||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { [weak self] in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sneak: fixed missing weak reference
DispatchQueue.main.asyncAfter(deadline: .now() + 0.10) { | ||
expect(spy).notTo( | ||
haveBeenCalled( | ||
withArgs: [ | ||
CIS_SSDK_PLAYBACK_METRIC_PLAYER_STATE: "\(PlayerState.CONVIVA_BUFFERING.rawValue)" | ||
] | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced this pattern overall in this file to wrap it with waitUntil
as there was no guarantee that the current test is still running when the asyncAfter
executes the expect
.
self.internalEndSession() | ||
} | ||
self.playbackFinishedDispatchWorkItem = playbackFinishedDispatchWorkItem | ||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.10, execute: playbackFinishedDispatchWorkItem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
DispatchQueue.main.asyncAfter(deadline: .now() + 0.10, execute: playbackFinishedDispatchWorkItem) | |
DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100), execute: playbackFinishedDispatchWorkItem) |
or
DispatchQueue.main.asyncAfter(deadline: .now() + 0.10, execute: playbackFinishedDispatchWorkItem) | |
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1, execute: playbackFinishedDispatchWorkItem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 865222d
Problem
When playing a post-roll ad, "invalid session ID" error shows up on Conviva Touchstone.
Solution
Postponing ending the session from
onPlaybackFinished
event with a delay of0.1s
to check if there is anonAdBreakStarted
event is received and then only end the session onceonAdBreakFinished
event is seen fixes the problem.Notes
Both CSAI and SSAI ad integration were adjusted to address the problem overall.
Checklist
CHANGELOG.md
file - already added in Fix analytics video data auto collection #81