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

[FIX] Reload app for MM only on app update #1249

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

flavioislima
Copy link
Contributor

@flavioislima flavioislima commented Mar 5, 2025

This pull request includes changes to improve the client update handling and extension initialization process. The most important changes include adding a new function to reload for MetaMask, modifying the frontend to reload the app when a new version is detected, and restructuring the backend to handle the new reload functionality.

Changes to client update handling:

Changes to extension initialization:

  • src/backend/main.ts: Removed the extension initialization from the frontendReady event and added a new reloadForMM event to handle the initialization and reloading process. [1] [2]

HOW TO TEST

Issue is that on the current version the app reloads the interface after a few seconds (~5s) every time it's opened. With
this change it will only do that after an app update.

  • Run the App (Dev mode or artifact on any platform)
  • The app won't reload
  • Open Dev tools and go to > Applications > Local Storage and change the last_version field to a previous version (< 0.23.2)
  • Close the app and open it again.
  • The app should reload now after a few seconds.

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@flavioislima flavioislima added the PR: Ready-For-Review PR is ready to be reviewed by peers label Mar 5, 2025
Copy link
Collaborator

@BrettCleary BrettCleary left a comment

Choose a reason for hiding this comment

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

let's move the logic into a function that is only called in the main process

@flavioislima flavioislima requested a review from BrettCleary March 5, 2025 21:10
@BrettCleary
Copy link
Collaborator

I believe this would be the correct test case https://app.qase.io/case/HC-529. We should actually go back to 0.22.4 so a mm ext version changes https://github.com/HyperPlay-Gaming/hyperplay-desktop-client/releases/tag/v0.22.4

Copy link
Collaborator

@BrettCleary BrettCleary left a comment

Choose a reason for hiding this comment

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

lgtm. appreciate you migrating it to the backend over time. responded on the other comment thread 👍

Tested upgrading from v0.22.4 and it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Ready-For-Review PR is ready to be reviewed by peers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants