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

[P2PS] / Ameerul / P2PS-4532 PA client gets logout when login #17699

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

Conversation

ameerul-deriv
Copy link
Contributor

Changes:

Please provide a summary of the change.

  • Added is_authorize check in the useEffect before subscribing to p2p_settings as we have another authorize call in socket-general.js, and we didn't wait for that authorize check as well

Screenshots:

Please provide some screenshots of the change.

Copy link

vercel bot commented Dec 2, 2024

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Dec 2, 2024 9:48am

@coveralls
Copy link

coveralls commented Dec 2, 2024

Pull Request Test Coverage Report for Build 12116320764

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1 of 2 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 53.9%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/src/Stores/client-store.js 0 1 0.0%
Totals Coverage Status
Change from base Build 12113638056: 0.002%
Covered Lines: 32848
Relevant Lines: 56839

💛 - Coveralls

Copy link
Contributor

github-actions bot commented Dec 2, 2024

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/17699](https://github.com/deriv-com/deriv-app/pull/17699)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-ameerul-deriv-p2ps-4532-pa-client-get-d8e664.binary.sx?qa_server=red.derivws.com&app_id=32109
    - **Original**: https://deriv-app-git-fork-ameerul-deriv-p2ps-4532-pa-client-get-d8e664.binary.sx
- **App ID**: `32109`

Copy link
Contributor

github-actions bot commented Dec 2, 2024

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 34
🟧 Accessibility 70
🟢 Best practices 92
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-ameerul-deriv-p2ps-4532-pa-client-get-d8e664.binary.sx/

@@ -1635,7 +1635,7 @@ export default class ClientStore extends BaseStore {
if (this.is_logged_in) {
this.getWalletMigrationState();

await WS.mt5LoginList().then(this.responseMt5LoginList);
await WS.authorized.mt5LoginList().then(this.responseMt5LoginList);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will this have any impact on the user? From what yashim has explained to me, this will slow the call a little since it will check for auth first before calling mt5_login_list, but will this impact any other major flows?

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 already checking this.is_logged_in then why need authorized 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.

because for certain PA accounts, (idk why this happens) it will call this specific mt5_login_list endpoint before we authorize during login. Currently when we login, one websocket is created, and then a second is created, and this mt5_login_list gets called in the second websocket, before authorize. So we need to use WS.authorized to make sure it waits for authorized call before calling mt5_login_list

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.

4 participants