Skip to content

Conversation

Hantex9
Copy link
Contributor

@Hantex9 Hantex9 commented Aug 6, 2025

Short description

This PR introduces improvements to how the WebviewComponent handles user agent headers, as well as refactors the CGN landing playground to use a more robust source object for webview navigation. The main themes are enhanced webview header configuration and improved playground usability.

List of changes proposed in this pull request

  • Added a getDefaultUserAgent function to set a platform-specific user agent string for webview requests, ensuring consistent identification across iOS, Android, and other platforms that CGN merchants will use.
  • Edited the webview source prop to always include the correct User-Agent header, merging with any existing headers.
    Error handling improvements:
  • Added a useEffect to reset error state when the webview source changes, preventing stale error messages when navigating to new URLs.
  • Refactored the CGN landing playground to use a WebViewSourceUri object for navigation, simplifying state management and making header manipulation more explicit.
  • Updated the playground to pass the new playgroundEnabled prop to the webview component, enabling enhanced testing features that allow merchants to check the error pages if the webview goes into error without showing the standard umbrella.

How to test

⚠️ It's important to test this implementation with the production environment, ensuring that for those merchants with a landing page discount, the webview with the page is displayed successfully.

@Hantex9 Hantex9 self-assigned this Aug 6, 2025
@Hantex9 Hantex9 added the IO-Bonus e pagamenti IO - Bonus e pagamenti label Aug 6, 2025
@Hantex9 Hantex9 requested a review from a team as a code owner August 6, 2025 18:45
Copy link
Contributor

github-actions bot commented Aug 6, 2025

PR Title Validation for conventional commit type

All good! PR title follows the conventional commit type.

Copy link
Contributor

github-actions bot commented Aug 6, 2025

Jira Pull Request Link

This Pull Request refers to Jira issues:

Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 53.33333% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.09%. Comparing base (dbcb339) to head (8431623).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...tings/devMode/playgrounds/CgnLandingPlayground.tsx 0.00% 4 Missing ⚠️
ts/components/WebviewComponent.tsx 72.72% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7261   +/-   ##
=======================================
  Coverage   59.08%   59.09%           
=======================================
  Files        1764     1764           
  Lines       37362    37371    +9     
  Branches     8489     8491    +2     
=======================================
+ Hits        22077    22083    +6     
- Misses      15205    15221   +16     
+ Partials       80       67   -13     
Files with missing lines Coverage Δ
ts/components/WebviewComponent.tsx 81.25% <72.72%> (-5.71%) ⬇️
...tings/devMode/playgrounds/CgnLandingPlayground.tsx 15.38% <0.00%> (ø)

... and 13 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 052bbdf...8431623. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants