Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ Legend:

Features that can be toggled on-off with the `experiments_users` and `experiments_guests` bit flags:

| Bit | Status | Introduced | Ended | Description |
|-----|--------|----------------------------------|-------|-----------------------------------------------------------------------------------------------------------------------------|
| 1 | Active | Web 21.1.0<br>Desktop 1.2.2-beta | - | Instead of refreshing the participant list repeatingly during calls, the data is generated from received signaling messages |
| 2 | Active | Web 21.1.0<br>Desktop 1.2.2 | - | Make automatic attempts to recover suspended / expired signaling session to allow join the call without page reload |
| Bit | Status | Introduced | Ended | Description |
|-----|--------|----------------------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------|
| 1 | Active | Web 21.1.0<br>Desktop 1.2.2-beta | - | Instead of refreshing the participant list repeatingly during calls, the data is generated from received signaling messages |
| 2 | Active | Web 21.1.0<br>Desktop 1.2.2 | - | Make automatic attempts to recover suspended / expired signaling session to allow join the call without page reload |
| 4 | Ended | Web 22.0.3<br>Desktop 2.0.4 | Web 23.0<br>Desktop 3.0 | Send chat messages via the High performance-backend / websocket |
| 8 | Active | Web 22.0.3<br>Desktop 2.0.4 | - | Mark sessions immediately as inactive when switching away from Talk |
18 changes: 12 additions & 6 deletions src/composables/useActiveSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { computed, onBeforeMount, onBeforeUnmount, ref, watch } from 'vue'
import { useStore } from 'vuex'
import { CONFIG, SESSION } from '../constants.ts'
import BrowserStorage from '../services/BrowserStorage.js'
import { getTalkConfig, hasTalkFeature } from '../services/CapabilitiesManager.ts'
import { setSessionState } from '../services/participantsService.js'
import { useTokenStore } from '../stores/token.ts'
Expand All @@ -16,6 +17,7 @@ import { useIsInCall } from './useIsInCall.js'
const INACTIVE_TIME_MS = 3 * 60 * 1000

const experimentalRecoverSession = (getTalkConfig('local', 'experiments', 'enabled') ?? 0) & CONFIG.EXPERIMENTAL.RECOVER_SESSION
const experimentalInactiveOnBlur = (getTalkConfig('local', 'experiments', 'enabled') ?? 0) & CONFIG.EXPERIMENTAL.SESSION_INACTIVE_ON_BLUR

/**
* Check whether the current session is active or not:
Expand Down Expand Up @@ -123,13 +125,17 @@ export function useActiveSession() {
document.body.removeEventListener('mouseenter', handleMouseEnter)
document.body.removeEventListener('mouseleave', handleMouseLeave)
} else if (type === 'blur') {
inactiveTimer.value = setTimeout(() => {
if (!experimentalInactiveOnBlur || BrowserStorage.getItem('pause-notification-on-blur') === 'yes') {
inactiveTimer.value = setTimeout(() => {
setSessionAsInactive()
}, INACTIVE_TIME_MS)

// Listen for mouse events to track activity on tab
document.body.addEventListener('mouseenter', handleMouseEnter)
document.body.addEventListener('mouseleave', handleMouseLeave)
} else {
setSessionAsInactive()
}, INACTIVE_TIME_MS)

// Listen for mouse events to track activity on tab
document.body.addEventListener('mouseenter', handleMouseEnter)
document.body.addEventListener('mouseleave', handleMouseLeave)
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export const CONFIG = {
* Send chat messages via the High performance-backend / websocket
*/
CHAT_RELAY: 4,
/**
* Since 22.0.3
* Mark sessions immediately as inactive when switching away from Talk
*/
SESSION_INACTIVE_ON_BLUR: 8,
},
} as const

Expand Down