Skip to content

Conversation

@LyubovSugak
Copy link
Collaborator

@LyubovSugak LyubovSugak commented Dec 3, 2025

https://axelspringer.atlassian.net/browse/TIPPI-796

  • Improve conditions check, test coverage of doPlugin_global
  • move extensions to github

@LyubovSugak LyubovSugak requested a review from Copilot December 9, 2025 09:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the robustness of the Tippi extensions for WELT by adding comprehensive null/undefined checks and improving test coverage. The changes focus on defensive programming practices to prevent runtime errors when global objects like window.utag are not available.

Key changes:

  • Added guard clauses checking for window.utag and window.utag.data existence across multiple utility functions
  • Introduced two new extension files: media_tracking.js and braze_checkout_tracking.js
  • Added comprehensive test suites for both new extensions with over 900 lines of test coverage

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/welt/media_tracking.test.js Comprehensive test suite for media tracking interceptor functionality
tests/welt/braze_checkout_tracking.test.js Complete test coverage for Braze checkout success tracking
extensions/welt/media_tracking.js New extension that intercepts utag.link to add event40 for first 'pos' event per media_id
extensions/welt/braze_checkout_tracking.js New extension for tracking checkout success events in Braze
extensions/doPlugins/doPlugins_global.js Added defensive null checks throughout utility functions to prevent runtime errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +86 to +91
return !!(!!s.pageName && (s.pageName.indexOf('42925516') !== -1
|| s.pageName.indexOf('54578900') !== -1)
|| window.location.toString().indexOf('unangemeldet-42925516') !== -1
|| window.location.toString().indexOf('unangemeldet-54578900') !== -1
|| (!!window.utag.data['dom.pathname'] && window.utag.data['dom.pathname'].indexOf('adblockwall.html') !== -1)
|| (!!window.utag.data.page_document_type && window.utag.data.page_document_type.indexOf('adwall') !== -1));
|| (window.utag && window.utag.data && window.utag.data['dom.pathname'] && window.utag.data['dom.pathname'].indexOf('adblockwall.html') !== -1)
|| (window.utag && window.utag.data && window.utag.data.page_document_type && window.utag.data.page_document_type.indexOf('adwall') !== -1));
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The double negation on line 86 (!!) is redundant since the entire expression is already wrapped in !!(). Remove the inner !! before s.pageName to simplify the code without changing its behavior.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link

Copilot AI commented Dec 9, 2025

@LyubovSugak I've opened a new pull request, #330, to work on those changes. Once the pull request is ready, I'll request review from you.

@LyubovSugak LyubovSugak changed the title Tippi 796 extensions welt fix: [TIPPI-796] extensions welt Dec 9, 2025
@LyubovSugak LyubovSugak merged commit e132a1d into master Dec 10, 2025
4 checks passed
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