Skip to content
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

Aswathy/fix: Incorrect Logged-In Status and Missing Residence Country in Growthbook #17966

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

aswathy-deriv
Copy link
Contributor

Changes:

Please provide a summary of the change.

Screenshots:

Please provide some screenshots of the change.

Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Jan 14, 2025 1:47pm

@aswathy-deriv aswathy-deriv changed the title Aswathy/fix: loggedin value is set to false and reidence to null Aswathy/fix: loggedin value is set to false and residence to null Jan 9, 2025
@aswathy-deriv aswathy-deriv changed the title Aswathy/fix: loggedin value is set to false and residence to null Aswathy/Incorrect Logged-In Status and Missing Residence Country in Growthbook Jan 9, 2025
@aswathy-deriv aswathy-deriv changed the title Aswathy/Incorrect Logged-In Status and Missing Residence Country in Growthbook Aswathy/fix: Incorrect Logged-In Status and Missing Residence Country in Growthbook Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 10, 2025

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/deriv-com/deriv-app/pull/17966](https://github.com/deriv-com/deriv-app/pull/17966)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-aswathy-deriv-loggedinresidenceissue.binary.sx?qa_server=red.derivws.com&app_id=32466
    - **Original**: https://deriv-app-git-fork-aswathy-deriv-loggedinresidenceissue.binary.sx
- **App ID**: `32466`

Copy link
Contributor

github-actions bot commented Jan 10, 2025

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 27
🟧 Accessibility 70
🟧 Best practices 83
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-aswathy-deriv-loggedinresidenceissue.binary.sx/

},
};
Analytics.setAttributes(analytics_config_config);
await Analytics?.initialise(config);
Copy link
Contributor

Choose a reason for hiding this comment

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

[Q]: why do we need to initialize the whole Analytics package again? 🤔 only updating the attributes would be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will work only when we re-initialize it for the logout session.can you check it and let me know if it is possible in any other way.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm looking into this. will update you on this


const client_information = Cookies.getJSON('client_information');
const client_information = Cookies.get('client_information')
? JSON.parse(Cookies.get('client_information') || '')
Copy link
Contributor

Choose a reason for hiding this comment

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

we are checking if cookie exists in line 31. So do we need || '' in line 32 again?

if (process.env.REMOTE_CONFIG_URL) {
const flags = await fetch(process.env.REMOTE_CONFIG_URL)
.then(res => res.json())
.catch(() => FIREBASE_INIT_DATA);
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need this whole initialization again?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The attributes are not getting updated without initialization.we can check if there is a way without doing the initialization again.

},
},
};
await Analytics?.initialise(config);
Analytics.setAttributes(analytics_config_config);
Copy link
Contributor

@amina-deriv amina-deriv Jan 15, 2025

Choose a reason for hiding this comment

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

What is the use of setAttributes here? we have initialized growthbook with same config in line 65
and nothing changed in attributes.

@shayan-deriv
Copy link
Contributor

We can close this PR in favor of PR #18037

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