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: Keep screen awake #3066

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

yanguoyu
Copy link
Collaborator

@yanguoyu yanguoyu commented Mar 9, 2024

Add an option for users to keep the screen awake. Refer to Magickbase/neuron-public-issues#319

Because the screen recording cannot capture the screen lock, the video was not uploaded.

@Danie0918
Copy link
Collaborator

@homura Please have a review.

packages/neuron-ui/src/utils/wakeScreen.ts Outdated Show resolved Hide resolved
@Keith-CY
Copy link
Collaborator

Keith-CY commented Apr 9, 2024

/package

Packaging for test is done in 8610166731. @Keith-CY

@Keith-CY
Copy link
Collaborator

Any update on this @silySuper

@silySuper
Copy link
Collaborator

It is testing ,and will finish today in expect.

@silySuper
Copy link
Collaborator

After about 1 hour Lock screen ,sync process is increased only about 1%;and sync can not change when unlock screen.
an error show in main.log

[error] Unhandled Rejection in task: Reason: AbortError: This operation was aborted
at Object.fetch (node:internal/deps/undici/undici:11372:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async LightRPC.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/node_modules/@ckb-lumos/rpc/lib/method.js:57:19)
at async LightSynchronizer.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:88:28)
at async LightSynchronizer.upsertTxHashes (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:104:29)
at async LightSynchronizer.synchronize (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:76:29)
at async LightSynchronizer.initSync (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:202:13)
[2024-04-10T11:13:24.972Z] [error] Sync:ChildProcess: [2024-04-10T11:13:24.967Z] [error] Unhandled Rejection in task: Reason: AbortError: This operation was aborted
at Object.fetch (node:internal/deps/undici/undici:11372:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async LightRPC.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/node_modules/@ckb-lumos/rpc/lib/method.js:57:19)
at async LightSynchronizer.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:88:28)
at async LightSynchronizer.upsertTxHashes (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:104:29)
at async LightSynchronizer.synchronize (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:76:29)
at async LightSynchronizer.initSync (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:202:13)

main.log

@yanguoyu
Copy link
Collaborator Author

After about 1 hour Lock screen ,sync process is increased only about 1%;and sync can not change when unlock screen. an error show in main.log

[error] Unhandled Rejection in task: Reason: AbortError: This operation was aborted at Object.fetch (node:internal/deps/undici/undici:11372:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async LightRPC.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/node_modules/@ckb-lumos/rpc/lib/method.js:57:19) at async LightSynchronizer.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:88:28) at async LightSynchronizer.upsertTxHashes (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:104:29) at async LightSynchronizer.synchronize (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:76:29) at async LightSynchronizer.initSync (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:202:13) [2024-04-10T11:13:24.972Z] [error] Sync:ChildProcess: [2024-04-10T11:13:24.967Z] [error] Unhandled Rejection in task: Reason: AbortError: This operation was aborted at Object.fetch (node:internal/deps/undici/undici:11372:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async LightRPC.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/node_modules/@ckb-lumos/rpc/lib/method.js:57:19) at async LightSynchronizer.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:88:28) at async LightSynchronizer.upsertTxHashes (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:104:29) at async LightSynchronizer.synchronize (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:76:29) at async LightSynchronizer.initSync (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:202:13)

main.log

[2024-04-10T10:57:52.809Z] [info]  Database:	saved synced block #2110000
[2024-04-10T11:13:24.967Z] [error] Unhandled Rejection in task:	Reason: AbortError: This operation was aborted
    at Object.fetch (node:internal/deps/undici/undici:11372:11)

Hi, when is the window locked? From the log, after 15 minutes in normal logs, the error log shows. This may be not a problem with this PR, but I will still find out what happened.

@silySuper
Copy link
Collaborator

After about 1 hour Lock screen ,sync process is increased only about 1%;and sync can not change when unlock screen. an error show in main.log
[error] Unhandled Rejection in task: Reason: AbortError: This operation was aborted at Object.fetch (node:internal/deps/undici/undici:11372:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async LightRPC.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/node_modules/@ckb-lumos/rpc/lib/method.js:57:19) at async LightSynchronizer.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:88:28) at async LightSynchronizer.upsertTxHashes (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:104:29) at async LightSynchronizer.synchronize (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:76:29) at async LightSynchronizer.initSync (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:202:13) [2024-04-10T11:13:24.972Z] [error] Sync:ChildProcess: [2024-04-10T11:13:24.967Z] [error] Unhandled Rejection in task: Reason: AbortError: This operation was aborted at Object.fetch (node:internal/deps/undici/undici:11372:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async LightRPC.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/node_modules/@ckb-lumos/rpc/lib/method.js:57:19) at async LightSynchronizer.getTransactions (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:88:28) at async LightSynchronizer.upsertTxHashes (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:104:29) at async LightSynchronizer.synchronize (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:76:29) at async LightSynchronizer.initSync (/Users/chllp/Downloads/Neuron 3.app/Contents/Resources/app/dist/block-sync-renderer/sync/light-synchronizer.js:202:13)
main.log

[2024-04-10T10:57:52.809Z] [info]  Database:	saved synced block #2110000
[2024-04-10T11:13:24.967Z] [error] Unhandled Rejection in task:	Reason: AbortError: This operation was aborted
    at Object.fetch (node:internal/deps/undici/undici:11372:11)

Hi, when is the window locked? From the log, after 15 minutes in normal logs, the error log shows. This may be not a problem with this PR, but I will still find out what happened.

From about 19:00 to 20:00 yesterday

@yanguoyu
Copy link
Collaborator Author

@silySuper Do you set the keep screen awake on when the screen is locked?

@silySuper
Copy link
Collaborator

yes

@yanguoyu
Copy link
Collaborator Author

yes

So, the actual problem is when you set the keep the screen awake on, the screen is still locked after the preference locked time ends? Have you ever minimized the Neuron window?

@silySuper
Copy link
Collaborator

silySuper commented Apr 11, 2024

yes

So, the actual problem is when you set the keep the screen awake on, the screen is still locked after the preference locked time ends? Have you ever minimized the Neuron window?

I can not remember whether I have minimized the Neuron window.Because I have not see any tips about Neuron window operation before,so I do not pay close attention to this point.I have record a new screen recording before locking screen.

2024-04-11.14.02.37.mov

After half an hour:

2024-04-11.14.30.43.mov

main.log

@yanguoyu
Copy link
Collaborator Author

yes

So, the actual problem is when you set the keep the screen awake on, the screen is still locked after the preference locked time ends? Have you ever minimized the Neuron window?

I can not remember whether I have minimized the Neuron window.Because I have not see any tips about Neuron window operation before,so I do not pay close attention to this point.I have record a new screen recording before locking screen.

2024-04-11.14.02.37.mov
After half an hour:

2024-04-11.14.30.43.mov
main.log

And after half an hour I will offer a sync process picture.

To test this PR, I suggest setting the Computer's locked time to 1 minute, but not half an hour, then we will test this PR quickly but not need to wait for half an hour.

@silySuper
Copy link
Collaborator

yes

So, the actual problem is when you set the keep the screen awake on, the screen is still locked after the preference locked time ends? Have you ever minimized the Neuron window?

I can not remember whether I have minimized the Neuron window.Because I have not see any tips about Neuron window operation before,so I do not pay close attention to this point.I have record a new screen recording before locking screen.
2024-04-11.14.02.37.mov
After half an hour:
2024-04-11.14.30.43.mov
main.log
And after half an hour I will offer a sync process picture.

To test this PR, I suggest setting the Computer's locked time to 1 minute, but not half an hour, then we will test this PR quickly but not need to wait for half an hour.

1 minute can not see sync process clearly,sometimes sync can not sync quickly before.

@yanguoyu
Copy link
Collaborator Author

yes

So, the actual problem is when you set the keep the screen awake on, the screen is still locked after the preference locked time ends? Have you ever minimized the Neuron window?

I can not remember whether I have minimized the Neuron window.Because I have not see any tips about Neuron window operation before,so I do not pay close attention to this point.I have record a new screen recording before locking screen.
2024-04-11.14.02.37.mov
After half an hour:
2024-04-11.14.30.43.mov
main.log
And after half an hour I will offer a sync process picture.

To test this PR, I suggest setting the Computer's locked time to 1 minute, but not half an hour, then we will test this PR quickly but not need to wait for half an hour.

1 minute can not see sync process clearly,sometimes sync can not sync quickly before.

I can not get the point, this PR is to avoid the screen locked when the switch opens.
IMO, to test the sync with the lock screen, it's unnecessary to use this package. Another package can also test that case.

@silySuper
Copy link
Collaborator

I click wrong

@yanguoyu yanguoyu requested a review from silySuper April 11, 2024 07:49
@silySuper
Copy link
Collaborator

yes

So, the actual problem is when you set the keep the screen awake on, the screen is still locked after the preference locked time ends? Have you ever minimized the Neuron window?

I can not remember whether I have minimized the Neuron window.Because I have not see any tips about Neuron window operation before,so I do not pay close attention to this point.I have record a new screen recording before locking screen.
2024-04-11.14.02.37.mov
After half an hour:
2024-04-11.14.30.43.mov
main.log
And after half an hour I will offer a sync process picture.

To test this PR, I suggest setting the Computer's locked time to 1 minute, but not half an hour, then we will test this PR quickly but not need to wait for half an hour.

1 minute can not see sync process clearly,sometimes sync can not sync quickly before.

I can not get the point, this PR is to avoid the screen locked when the switch opens. IMO, to test the sync with the lock screen, it's unnecessary to use this package. Another package can also test that case.

what does this mean?

@Keith-CY Keith-CY added this pull request to the merge queue Apr 12, 2024
Merged via the queue into nervosnetwork:develop with commit 3d3e767 Apr 12, 2024
10 checks passed
@yanguoyu yanguoyu deleted the feat-keep-awake branch April 12, 2024 07:59
@Keith-CY Keith-CY mentioned this pull request Apr 14, 2024
@yanguoyu yanguoyu mentioned this pull request Apr 15, 2024
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.

6 participants