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

feat:Detect new upgrade on launch #2769

Conversation

alexsupa597
Copy link
Contributor

@alexsupa597 alexsupa597 commented Jul 10, 2023

What problem does this PR solve?

As title.

2023-07-12.17.38.46.mov

Ref: Magickbase/neuron-public-issues#139

Check List

Test

e2e Test

@alexsupa597 alexsupa597 marked this pull request as draft July 10, 2023 08:25
@alexsupa597 alexsupa597 force-pushed the fix/detect-new-upgrade-on-launch branch 5 times, most recently from a01bf42 to ce02797 Compare July 12, 2023 09:35
@alexsupa597 alexsupa597 force-pushed the fix/detect-new-upgrade-on-launch branch from ce02797 to c7f2544 Compare July 12, 2023 09:37
@alexsupa597 alexsupa597 marked this pull request as ready for review July 12, 2023 09:37
@yanguoyu
Copy link
Collaborator

yanguoyu commented Jul 13, 2023

It will open a dialog like that if there is no update when I open the setting page. @JeffreyMa597

image

And if there is no update when I open Neuron, but after a while, there exists an update version, when I click check for update on the setting page, the dialog will close after checking the update. @JeffreyMa597

exception.mov

On the other hand, do we only check once when we open Neuron or should we check for updates every some intervals? @Danie0918

packages/neuron-ui/src/components/GeneralSetting/index.tsx Outdated Show resolved Hide resolved
@@ -135,7 +135,9 @@ const GeneralSetting = ({ updater }: GeneralSettingProps) => {
const [showLangDialog, setShowLangDialog] = useState(false)
const [searchParams] = useSearchParams()
const [errorMsg, setErrorMsg] = useState('')
const [dialogType, setDialogType] = useState<'' | 'checking' | 'updating' | 'updated'>('')
const [dialogType, setDialogType] = useState<'' | 'checking' | 'checked' | 'updating' | 'updated'>('')
Copy link
Collaborator

Choose a reason for hiding this comment

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

The new type checked can be avoided by const isChecked = !!updater.version

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 new type checked can be avoided by const isChecked = !!updater.version

In the logic of the function handleUpdate, there needs to a key to open our installation dialog, and on the other hand, we don't want the installation dialog to open as soon as we enter the page.

packages/neuron-ui/src/widgets/Dot/dot.module.scss Outdated Show resolved Hide resolved
@Keith-CY
Copy link
Collaborator

Keith-CY commented Jul 13, 2023

It will open a dialog like that if there is no update when I open the setting page. @JeffreyMa597

image And if there is no update when I open Neuron, but after a while, there exists an update version, when I click `check for update` on the setting page, the dialog will close after checking the update. @JeffreyMa597

exception.mov
On the other hand, do we only check once when we open Neuron or should we check for updates every some intervals? @Danie0918

I would suggest checking new updates daily because some may keep Neuron open if it synchronizes slowly. The case may be rare but the cost is low

@Danie0918
Copy link
Collaborator

It will open a dialog like that if there is no update when I open the setting page. @JeffreyMa597
image
And if there is no update when I open Neuron, but after a while, there exists an update version, when I click check for update on the setting page, the dialog will close after checking the update. @JeffreyMa597
exception.mov
On the other hand, do we only check once when we open Neuron or should we check for updates every some intervals? @Danie0918

I would suggest checking new updates daily because some may keep Neuron open if it synchronizes slowly. The case may be rare but the cost is low

Yes, it is true that there may be users who keep Neuron open. So here we need to add a daily check in addition to the open check, how about we set it to UTC+0 check?

@alexsupa597 alexsupa597 force-pushed the fix/detect-new-upgrade-on-launch branch from f1dbee4 to a31fcff Compare July 14, 2023 13:38
@alexsupa597
Copy link
Contributor Author

alexsupa597 commented Jul 14, 2023

/package

Packaging for test is done in 5554741165. @JeffreyMa597

@alexsupa597 alexsupa597 force-pushed the fix/detect-new-upgrade-on-launch branch from a31fcff to b24f87d Compare July 15, 2023 04:52
@yanguoyu
Copy link
Collaborator

how about we set it to UTC+0 check?

If we check it at UTC+0, we should check whether the current is UTC+0 every period of time. How about checking it every period of time?

@Danie0918
Copy link
Collaborator

how about we set it to UTC+0 check?

If we check it at UTC+0, we should check whether the current is UTC+0 every period of time. How about checking it every period of time?

OK, set up a 24-hour check.

@yanguoyu
Copy link
Collaborator

Close with #2783

@yanguoyu yanguoyu closed this Jul 24, 2023
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