Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

fix: Avoid showing ThirdPartyApp message for the cookies warning flow #3676

Merged
merged 1 commit into from
Mar 15, 2022

Conversation

yagopv
Copy link
Member

@yagopv yagopv commented Mar 15, 2022

What it solves

Resolves safe-global/safe-react-apps#383

How this PR fixes it

By adding a condition to not show the message when the origin is the iframe validating the third party cookies activation

How to test it

  1. Third party cookies warning should continue to work as before
  2. ThirdPartyApp message should not be present in the console

@yagopv yagopv requested review from mmv08 and dasanra March 15, 2022 11:17
@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1986313656

  • 0 of 2 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 34.838%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/safe/components/Apps/hooks/useIframeMessageHandler.ts 0 1 0.0%
src/routes/safe/components/Apps/hooks/useThirdPartyCookies.ts 0 1 0.0%
Totals Coverage Status
Change from base Build 1985726917: -0.005%
Covered Lines: 3375
Relevant Lines: 8776

💛 - Coveralls

@github-actions
Copy link

Deployment links

🟠 Rinkeby Mainnet 🟣 Polygon 🟡 BSC Arbitrum 🟢 Gnosis Chain

Copy link
Member

@iamacook iamacook left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -112,9 +113,10 @@ const useIframeMessageHandler = (
data: SDKMessageToPayload[SDKMessageIds]
}>,
) => {
if (message.origin === window.origin) {
if (message.origin === window.origin || message.origin === THIRD_PARTY_COOKIES_CHECK_URL) {
Copy link
Member

Choose a reason for hiding this comment

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

Stylistic, but you can simplify this:

Suggested change
if (message.origin === window.origin || message.origin === THIRD_PARTY_COOKIES_CHECK_URL) {
if ([window.origin, THIRD_PARTY_COOKIES_CHECK_URL].includes(message.origin)) {

@JagoFigueroa
Copy link

Magnifico. Thank you Yago ;)

@yagopv yagopv merged commit a6323ad into dev Mar 15, 2022
@yagopv yagopv deleted the fix/third-party-app-message-for-cookies-warning branch March 15, 2022 16:04
@github-actions github-actions bot locked and limited conversation to collaborators Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ThirdPartyApp error in console
5 participants