diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index cbb5347173..bb413ffac4 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -43,7 +43,7 @@ jobs: - name: Get commit details id: commit if: github.event.workflow_run.event == 'pull_request' - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: script: | const response = await github.rest.git.getCommit({ @@ -82,7 +82,7 @@ jobs: # Run 4 instances in Parallel runner: [1, 2, 3, 4] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # XXX: We're checking out untrusted code in a secure context # We need to be careful to not trust anything this code outputs/may do @@ -147,7 +147,7 @@ jobs: - name: Upload Artifact if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: cypress-results path: | diff --git a/.github/workflows/element-web.yaml b/.github/workflows/element-web.yaml index b1bb128457..ff8c8ddee7 100644 --- a/.github/workflows/element-web.yaml +++ b/.github/workflows/element-web.yaml @@ -17,7 +17,7 @@ jobs: name: "Build Element-Web" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -46,7 +46,7 @@ jobs: working-directory: ./element-web - name: Upload Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: previewbuild path: element-web/webapp diff --git a/.github/workflows/i18n_check.yml b/.github/workflows/i18n_check.yml index 2acfb12685..cd350fc892 100644 --- a/.github/workflows/i18n_check.yml +++ b/.github/workflows/i18n_check.yml @@ -12,7 +12,7 @@ jobs: - name: "Get modified files" id: changed_files if: github.event_name == 'pull_request' && github.event.pull_request.user.login != 'RiotTranslateBot' - uses: tj-actions/changed-files@v19 + uses: tj-actions/changed-files@v34 with: files: | src/i18n/strings/* diff --git a/.github/workflows/notify-element-web.yml b/.github/workflows/notify-element-web.yml index 4b45c95a89..1ebbe13747 100644 --- a/.github/workflows/notify-element-web.yml +++ b/.github/workflows/notify-element-web.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'matrix-org/matrix-react-sdk' steps: - name: Notify element-web repo that a new SDK build is on develop - uses: peter-evans/repository-dispatch@v1 + uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.ELEMENT_BOT_TOKEN }} repository: vector-im/element-web diff --git a/.github/workflows/static_analysis.yaml b/.github/workflows/static_analysis.yaml index 4c773f9258..36ebf978ea 100644 --- a/.github/workflows/static_analysis.yaml +++ b/.github/workflows/static_analysis.yaml @@ -14,7 +14,7 @@ jobs: name: "Typescript Syntax Check" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -89,7 +89,7 @@ jobs: name: "Rethemendex Check" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: ./res/css/rethemendex.sh @@ -99,7 +99,7 @@ jobs: name: "ESLint" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -116,7 +116,7 @@ jobs: name: "Style Lint" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -133,7 +133,7 @@ jobs: name: "Analyse Dead Code" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1985610ae3..9412024d46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Yarn cache uses: actions/setup-node@v3 @@ -38,7 +38,7 @@ jobs: run: "yarn coverage --ci --reporters github-actions --max-workers ${{ steps.cpu-cores.outputs.count }}" - name: Upload Artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: coverage path: | @@ -49,7 +49,7 @@ jobs: name: Element Web Integration Tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: diff --git a/package.json b/package.json index 1a7829fa14..a30774c30a 100644 --- a/package.json +++ b/package.json @@ -72,9 +72,9 @@ "counterpart": "^0.18.6", "diff-dom": "^4.2.2", "diff-match-patch": "^1.0.5", - "emojibase": "6.0.2", - "emojibase-data": "7.0.0", - "emojibase-regex": "6.0.0", + "emojibase": "6.1.0", + "emojibase-data": "7.0.1", + "emojibase-regex": "6.0.1", "escape-html": "^1.0.3", "file-saver": "^2.0.5", "filesize": "6.1.0", @@ -149,7 +149,7 @@ "@types/classnames": "^2.2.11", "@types/commonmark": "^0.27.4", "@types/counterpart": "^0.18.1", - "@types/css-font-loading-module": "^0.0.6", + "@types/css-font-loading-module": "^0.0.7", "@types/diff-match-patch": "^1.0.32", "@types/enzyme": "^3.10.9", "@types/escape-html": "^1.0.1", @@ -161,7 +161,7 @@ "@types/lodash": "^4.14.168", "@types/modernizr": "^3.5.3", "@types/node": "^16", - "@types/pako": "^1.0.1", + "@types/pako": "^2.0.0", "@types/parse5": "^6.0.0", "@types/qrcode": "^1.3.5", "@types/react": "17.0.49", @@ -175,8 +175,8 @@ "@typescript-eslint/parser": "^5.6.0", "@wojtekmaj/enzyme-adapter-react-17": "^0.6.1", "allchange": "^1.1.0", - "axe-core": "^4.4.3", - "babel-jest": "^26.6.3", + "axe-core": "4.4.3", + "babel-jest": "^29.0.0", "blob-polyfill": "^6.0.20211015", "chokidar": "^3.5.1", "cypress": "^10.3.0", @@ -194,8 +194,8 @@ "eslint-plugin-react-hooks": "^4.3.0", "eslint-plugin-unicorn": "^44.0.2", "fetch-mock-jest": "^1.5.1", - "fs-extra": "^10.0.1", - "glob": "^7.1.6", + "fs-extra": "^11.0.0", + "glob": "^8.0.0", "jest": "^29.2.2", "jest-canvas-mock": "^2.3.0", "jest-environment-jsdom": "^29.2.2", diff --git a/res/css/views/beta/_BetaCard.pcss b/res/css/views/beta/_BetaCard.pcss index b47e7ca1b6..0f8d8a66e7 100644 --- a/res/css/views/beta/_BetaCard.pcss +++ b/res/css/views/beta/_BetaCard.pcss @@ -114,6 +114,10 @@ limitations under the License. } } } + + &:last-child { + margin-bottom: 0; + } } .mx_BetaCard_betaPill { diff --git a/res/css/views/elements/_SettingsFlag.pcss b/res/css/views/elements/_SettingsFlag.pcss index a581edae67..83c78ef39e 100644 --- a/res/css/views/elements/_SettingsFlag.pcss +++ b/res/css/views/elements/_SettingsFlag.pcss @@ -60,4 +60,8 @@ limitations under the License. font-family: $monospace-font-family !important; background-color: $rte-code-bg-color; } + + .mx_SettingsTab_microcopy_warning::before { + content: "⚠️ "; + } } diff --git a/src/LegacyCallHandler.tsx b/src/LegacyCallHandler.tsx index e13b0ec85c..ef1effdaf7 100644 --- a/src/LegacyCallHandler.tsx +++ b/src/LegacyCallHandler.tsx @@ -71,13 +71,52 @@ export const PROTOCOL_SIP_VIRTUAL = 'im.vector.protocol.sip_virtual'; const CHECK_PROTOCOLS_ATTEMPTS = 3; -enum AudioID { +type MediaEventType = keyof HTMLMediaElementEventMap; +const MEDIA_ERROR_EVENT_TYPES: MediaEventType[] = [ + 'error', + // The media has become empty; for example, this event is sent if the media has + // already been loaded (or partially loaded), and the HTMLMediaElement.load method + // is called to reload it. + 'emptied', + // The user agent is trying to fetch media data, but data is unexpectedly not + // forthcoming. + 'stalled', + // Media data loading has been suspended. + 'suspend', + // Playback has stopped because of a temporary lack of data + 'waiting', +]; +const MEDIA_DEBUG_EVENT_TYPES: MediaEventType[] = [ + 'play', + 'pause', + 'playing', + 'ended', + 'loadeddata', + 'loadedmetadata', + 'canplay', + 'canplaythrough', + 'volumechange', +]; + +const MEDIA_EVENT_TYPES = [ + ...MEDIA_ERROR_EVENT_TYPES, + ...MEDIA_DEBUG_EVENT_TYPES, +]; + +export enum AudioID { Ring = 'ringAudio', Ringback = 'ringbackAudio', CallEnd = 'callendAudio', Busy = 'busyAudio', } +/* istanbul ignore next */ +const debuglog = (...args: any[]): void => { + if (SettingsStore.getValue("debug_legacy_call_handler")) { + logger.log.call(console, "LegacyCallHandler debuglog:", ...args); + } +}; + interface ThirdpartyLookupResponseFields { /* eslint-disable camelcase */ @@ -119,6 +158,7 @@ export default class LegacyCallHandler extends EventEmitter { // call with a different party to this one. private transferees = new Map(); // callId (target) -> call (transferee) private audioPromises = new Map>(); + private audioElementsWithListeners = new Map(); private supportsPstnProtocol = null; private pstnSupportPrefixed = null; // True if the server only support the prefixed pstn protocol private supportsSipNativeVirtual = null; // im.vector.protocol.sip_virtual and im.vector.protocol.sip_native @@ -176,6 +216,16 @@ export default class LegacyCallHandler extends EventEmitter { } this.checkProtocols(CHECK_PROTOCOLS_ATTEMPTS); + + // Add event listeners for the