Skip to content

Duck Player: reportMetric support #1766

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

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

mgurgel
Copy link
Contributor

@mgurgel mgurgel commented Jun 23, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/task/1210602603977143?focus=true

Description

Implements the reportMetric shared method to increase observability of Duck Player

Testing Steps

  • Simulate an error by using one of the mock test setups, or by passing willThrow=true to the Duck Player special page
  • Check that a reportMetric message fires accordingly

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Copy link

netlify bot commented Jun 23, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 6c36057
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/687a50643956180008ff2a27
😎 Deploy Preview https://deploy-preview-1766--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

github-actions bot commented Jun 23, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Jun 23, 2025

[Beta] Generated file diff

Time updated: Fri, 18 Jul 2025 13:48:07 GMT

Android
    - android/contentScope.js
  • android/pages/duckplayer/dist/index.js

File has changed

Integration
    - integration/contentScope.js
  • integration/pages/duckplayer/dist/index.js

File has changed

Windows
    - windows/contentScope.js
  • windows/pages/duckplayer/dist/index.js

File has changed

Apple
    - dist/contentScope.js
  • dist/contentScopeIsolated.js
  • dist/pages/duckplayer/dist/index.js
  • dist/pages/duckplayer/index.html

File has changed

@mgurgel mgurgel force-pushed the mgurgel/duckplayer-report-metric branch 2 times, most recently from c3e373b to 19a125d Compare June 25, 2025 17:41
@mgurgel mgurgel self-assigned this Jun 25, 2025
@mgurgel mgurgel changed the title [WIP] Duck Player: reportMetric support Duck Player: reportMetric support Jun 25, 2025
@mgurgel mgurgel force-pushed the mgurgel/duckplayer-report-metric branch from 4470bdc to c5a93dc Compare June 26, 2025 15:46
@mgurgel mgurgel marked this pull request as ready for review June 26, 2025 15:47
@mgurgel mgurgel requested review from shakyShane and a team as code owners June 26, 2025 15:47
@mgurgel mgurgel force-pushed the mgurgel/duckplayer-report-metric branch 2 times, most recently from 830dbcb to 21261a5 Compare June 27, 2025 16:15
Copy link
Contributor

@shakyShane shakyShane left a comment

Choose a reason for hiding this comment

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

Just 1 thing to change with regards to how the init methods are called, other than that, looking really good 👍🏻

@mgurgel mgurgel force-pushed the mgurgel/duckplayer-report-metric branch from 365c6ad to 20cc7c7 Compare July 18, 2025 13:34
@mgurgel
Copy link
Contributor Author

mgurgel commented Jul 18, 2025

Regression tested on all platforms. The work supporting this on Android is due to go out next week.

cursor[bot]

This comment was marked as outdated.

@mgurgel
Copy link
Contributor Author

mgurgel commented Jul 18, 2025

@shakyShane @jonathanKingston Can we get this merged to Duck Player to unblock Android, and in the meantime I can flesh out the TD to potentially incorporate reportMetric into the messaging layer?

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Error Handling Issues in Embed Creation

This commit introduces two bugs:

  1. The ErrorBoundary's didCatch callback incorrectly accesses error?.error. The error parameter is the Error object itself, causing undefined to be passed to messaging.metrics.reportExceptionWithError and resulting in failed or incomplete exception reporting.
  2. A null return from createEmbedSettings is now incorrectly treated as an error. This function's type annotation indicates null is a valid return, leading to Error('Embed not found') being thrown and reported as a false positive.

special-pages/pages/duckplayer/app/index.js#L78-L88

embed = createEmbedSettings(window.location.href, settings);
if (!embed) {
throw new Error('Embed not found');
}
} catch (e) {
messaging.metrics.reportException({ message: e.message, kind: EXCEPTION_KIND_INIT_ERROR });
}
const didCatch = (error) => {
const message = error?.message;
messaging.metrics.reportExceptionWithError(error?.error);

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

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.

2 participants