Repository navigation
Milestone 3: controller matching - #4
Merged
Merged
Conversation
readMetadata treats an inactive controller as no session and rethrows other errors. mediaSessions pairs each tab with its active metadata, and matchCards maps each card to one session by exact title and artist, so a session is claimed at most once.
Records the controller matching change in the changelog and moves the roadmap to milestone 4 as next.
Cover a card matching its own session whatever order the sessions arrive in, and a card staying unmatched when its tab's controller is inactive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Milestone 3 of the roadmap:
src/controllers.jssafely reads metadata from each tab's media controller and matches media cards to sessions.readMetadatareturnsnullfor an inactive controller (NS_ERROR_NOT_AVAILABLE) and rethrows any other error.mediaSessionspairs each tab's browser with its active controller's metadata.readCardTrackreads the title and artist shown on a media card.matchCardsmaps each card to a session with the same title and artist. Each session is claimed at most once, and cards with no title never match.The bundle
zen-media-viz.uc.jsis unchanged becausesrc/index.jsdoes not import the module yet. Wiring happens in Milestone 5.How was it tested?
test/controllers.test.jscovers each function with fake controllers and DOM cards (happy-dom).test/fixtures/zen-1.24.3b.json).npm test,npm run lint,npm run format:checkandnpm run check:bundlepass locally.Checklist
npm test)npm run lintandnpm run format:checkpassnpm run build) if anything insrc/changed (not needed here: the bundle is unchanged)docs/manual-testing.mdchecked in a real Zen + Sine install (Milestone 5)CHANGELOG.mdupdated under Unreleased