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

Improve tracker API contract #560

Closed
1 task done
defagos opened this issue Sep 5, 2023 · 2 comments · Fixed by #647
Closed
1 task done

Improve tracker API contract #560

defagos opened this issue Sep 5, 2023 · 2 comments · Fixed by #647
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@defagos
Copy link
Member

defagos commented Sep 5, 2023

As a developer integrating Pillarbox I want custom tracker implementation to be easy to understand and achieve. Currently this is not the case from a Pillarbox developer point of view, at least looking at our comScore and Commanders Act implementations.

Context

Our current tracker implementations subscribe to various sources with subtle dependencies and slightly misaligned published values (see #559). After #559 has been investigated and hopefully implemented, we might be able to provide a better contract for custom tracker implementation.

Some ideas:

  • Maybe the context published in Publish consolidated item context #559, if this can be achieved, could be the source of truth for trackers. Maybe it should be publicly accessible with a dedicated API (computed properties) to extract valuable consistent state.
  • Maybe CurrentItemTracker could observe these changes and call another tracker protocol API method to notify trackers about essential changes. This could avoid implementations all having to perform the same kind of necessary subscription when the tracker is enabled.
  • Maybe objectWillChange (or did change if we add a run loop delay) could provide this change stream instead. Implementations would then access the player to get everything they need after a change.

Acceptance criteria

  • Tracker implementations are simple and do not require complex subscriptions to various sources.

Tasks

  • Implement the above strategies to find if one works.
@defagos defagos added this to Pillarbox Sep 5, 2023
@defagos defagos converted this from a draft issue Sep 5, 2023
@defagos defagos moved this from ✏️ Draft to 📋 Backlog in Pillarbox Sep 5, 2023
@defagos defagos added the enhancement New feature or request label Sep 5, 2023
@defagos defagos added this to the Analytics milestone Sep 5, 2023
@defagos
Copy link
Member Author

defagos commented Nov 20, 2023

Can likely be closed after #607 has been implemented.

@defagos defagos moved this from 📋 Backlog to 🚧 In Progress in Pillarbox Nov 23, 2023
@defagos
Copy link
Member Author

defagos commented Nov 23, 2023

The retained approach is to expand the PlayerItemTracker protocol with methods called when metadata or player properties are updated. This eliminates the need for apps to implement publisher subscriptions in their tracker implementation.

The objectWillChange idea was not required / implemented.

@defagos defagos linked a pull request Nov 23, 2023 that will close this issue
5 tasks
@defagos defagos moved this from 🚧 In Progress to 🍿 Code Review in Pillarbox Nov 24, 2023
@github-project-automation github-project-automation bot moved this from 🍿 Code Review to ✅ Done in Pillarbox Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants