teams-for-linux icon indicating copy to clipboard operation
teams-for-linux copied to clipboard

Always shown as available when locked, even if "awayOnSystemIdle=true"

Open willbennett-devops opened this issue 1 year ago • 4 comments

Describe the bug When --awayOnSystemIdle=true, I would expect to be shown as away or idle when I lock my computer, but instead I am eternally green. The issue is that teams will not forward messages to my phone while I am green, so during lunch or after work I don't ever see messages that sometimes are important.

To Reproduce Steps to reproduce the behavior:

  1. Launch app with --awayOnSystemIdle=true and --appIdleTimeout=10 (for debugging)
  2. Go idle, see state change to idle
  3. Lock screen, see state changed to "lock", and have someone else check your status, you will be green

Logs 10:45:49.108 › GetSystemIdleState => IdleTimeout: 15s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 30s, IdleState: 'idle' 10:45:51.109 › GetSystemIdleState => IdleTimeout: 15s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 32s, IdleState: 'idle' 10:45:53.121 › GetSystemIdleState => IdleTimeout: 15s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'active' 10:46:03.128 › GetSystemIdleState => IdleTimeout: 15s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 5s, IdleState: 'locked' 10:46:05.172 › GetSystemIdleState => IdleTimeout: 15s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 7s, IdleState: 'locked'

Expected behavior To not be green forever.

Desktop (please complete the following information):

  • OS: CachyOS
  • AUR
  • Version: 1.11.0-1

willbennett-devops avatar Oct 16 '24 14:10 willbennett-devops

Hi @willbennett-kaltura,

I think there has been a code refactor since I made this PR https://github.com/IsmaelMartinez/teams-for-linux/pull/1335 (see related discussions).

It did fix the logic when --awayOnSystemIdle=false and, for that case, it still works as it should (forever green/available).

Looking at the code right now, I guess either this check takes the wrong path: https://github.com/IsmaelMartinez/teams-for-linux/blob/c072ec5bf51be7a2fb2512654c90470f6a6337ed/app/browser/notifications/activityManager.js#L23

Or the bug is within this function: https://github.com/IsmaelMartinez/teams-for-linux/blob/c072ec5bf51be7a2fb2512654c90470f6a6337ed/app/browser/notifications/activityManager.js#L32

Note that I did not change the code in this last function in my PR, as it handles the case when --awayOnSystemIdle=true, and that was working fine back then.

kindofblues avatar Oct 17 '24 06:10 kindofblues

those code changes are for version 1.11.2. The version 1.11.0 still uses the older version

https://github.com/IsmaelMartinez/teams-for-linux/blob/v1.11.0/app/browser/notifications/activityManager.js

@willbennett-kaltura , are you able to run the app with --logConfig={} ? It will give us more logs and help us understand if this is a teams v1 or v2 issue.

I didn't write that logic what makes it a bit more difficult to digest.

Also, probably don't use the --appIdleTimeout=10 as I have seen issues with those timeouts getting confused (see https://github.com/IsmaelMartinez/teams-for-linux/issues/1320)

IsmaelMartinez avatar Oct 18 '24 10:10 IsmaelMartinez

those code changes are for version 1.11.2. The version 1.11.0 still uses the older version

https://github.com/IsmaelMartinez/teams-for-linux/blob/v1.11.0/app/browser/notifications/activityManager.js

@willbennett-kaltura , are you able to run the app with --logConfig={} ? It will give us more logs and help us understand if this is a teams v1 or v2 issue.

I didn't write that logic what makes it a bit more difficult to digest.

Also, probably don't use the --appIdleTimeout=10 as I have seen issues with those timeouts getting confused (see #1320)

Same issue with --logConfig={} and without --appIdleTimeout:

13:52:10.961 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:12.963 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:14.966 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:16.968 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:18.971 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked'

Honestly, I'd really like an option for immediately going idle on lock. Often times when I locked my computer, it means I'm afk and I'd like to get the notifications on my phone if possible.

willbennett-devops avatar Oct 21 '24 18:10 willbennett-devops

Aye, logs do seem to pick that is locked, but I am not sure what does it do. I will see when I can have a look at that code but is probably an old bug, so thanks for reporting.

On Mon, 21 Oct 2024, 19:18 Will Bennett, @.***> wrote:

those code changes are for version 1.11.2. The version 1.11.0 still uses the older version

https://github.com/IsmaelMartinez/teams-for-linux/blob/v1.11.0/app/browser/notifications/activityManager.js

@willbennett-kaltura https://github.com/willbennett-kaltura , are you able to run the app with --logConfig={} ? It will give us more logs and help us understand if this is a teams v1 or v2 issue.

I didn't write that logic what makes it a bit more difficult to digest.

Also, probably don't use the --appIdleTimeout=10 as I have seen issues with those timeouts getting confused (see #1320 https://github.com/IsmaelMartinez/teams-for-linux/issues/1320)

Same issue with --logConfig={} and without --appIdleTimeout:

13:52:10.961 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:12.963 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:14.966 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:16.968 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked' 13:52:18.971 › GetSystemIdleState => IdleTimeout: 300s, IdleTimeoutPollInterval: 10s, ActiveCheckPollInterval: 2s, IdleTime: 0s, IdleState: 'locked'

Honestly, I'd really like an option for immediately going idle on lock. Often times when I locked my computer, it means I'm afk and I'd like to get the notifications on my phone if possible.

— Reply to this email directly, view it on GitHub https://github.com/IsmaelMartinez/teams-for-linux/issues/1453#issuecomment-2427409624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJHEEVRQNUEJDF56XTYL3Z4VAONAVCNFSM6AAAAABQBVU22OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRXGQYDSNRSGQ . You are receiving this because you commented.Message ID: @.***>

IsmaelMartinez avatar Oct 21 '24 19:10 IsmaelMartinez

Hi @willbennett-kaltura , sorry for taking my time. I have been trying to digest some of the activityManager area and the system idle, but lets say it needs a lot of TLC.

Are you able to put all the logs, not only some lines? There is a screenlock inhibitor that might not getting disabled in some cases. That was added a while back ( https://github.com/IsmaelMartinez/teams-for-linux/issues/613 ) and might be taking part on this issue.

IsmaelMartinez avatar Nov 03 '24 09:11 IsmaelMartinez

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 04 '24 09:12 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Dec 09 '24 09:12 github-actions[bot]