diff --git a/ACKNOWLEDGMENTS.md b/ACKNOWLEDGMENTS.md index 4bffe877be4..47f789fb733 100644 --- a/ACKNOWLEDGMENTS.md +++ b/ACKNOWLEDGMENTS.md @@ -14517,7 +14517,7 @@ For more information on this, and how to apply and follow the GNU AGPL, see ``` -## libsignal-account-keys 0.1.0, libsignal-core 0.1.0, mrp 2.58.1, protobuf 2.58.1, ringrtc 2.58.1, regex-aot 0.1.0, partial-default-derive 0.1.0 +## libsignal-account-keys 0.1.0, libsignal-core 0.1.0, mrp 2.59.0, protobuf 2.59.0, ringrtc 2.59.0, regex-aot 0.1.0, partial-default-derive 0.1.0 ``` GNU AFFERO GENERAL PUBLIC LICENSE diff --git a/package.json b/package.json index 9b9259306b7..143961710e0 100644 --- a/package.json +++ b/package.json @@ -133,7 +133,7 @@ "@signalapp/libsignal-client": "0.81.1", "@signalapp/minimask": "1.0.1", "@signalapp/quill-cjs": "2.1.2", - "@signalapp/ringrtc": "2.58.1", + "@signalapp/ringrtc": "2.59.0", "@signalapp/sqlcipher": "2.4.4", "@signalapp/windows-ucv": "1.0.1", "@tanstack/react-virtual": "3.11.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4b64961a88b..b162101a86b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -135,8 +135,8 @@ importers: specifier: 2.1.2 version: 2.1.2 '@signalapp/ringrtc': - specifier: 2.58.1 - version: 2.58.1 + specifier: 2.59.0 + version: 2.59.0 '@signalapp/sqlcipher': specifier: 2.4.4 version: 2.4.4 @@ -3471,8 +3471,8 @@ packages: resolution: {integrity: sha512-y2sgqdivlrG41J4Zvt/82xtH/PZjDlgItqlD2g/Cv3ZbjlR6cGhTNXbfNygCJB8nXj+C7I28pjt1Zm3k0pv2mg==} engines: {npm: '>=8.2.3'} - '@signalapp/ringrtc@2.58.1': - resolution: {integrity: sha512-u+80Vl460f4U4Btnv3blp2kbtPt29FHdC63mXaf1Yor5C/DH4xeb7HwYPdHW28cLu6xVBNw/j9h8DPJ0jrvbZw==} + '@signalapp/ringrtc@2.59.0': + resolution: {integrity: sha512-d0nim4iS7bkQuER7dZ1CgJePTJ4o9lb7ktm+DVTR7QZkq527dpeSwWOaywoiqo7V06KVp1D0vhby2PMxxLjyug==} hasBin: true '@signalapp/sqlcipher@2.4.4': @@ -14253,7 +14253,7 @@ snapshots: lodash: 4.17.21 quill-delta: 5.1.0 - '@signalapp/ringrtc@2.58.1': + '@signalapp/ringrtc@2.59.0': dependencies: https-proxy-agent: 7.0.6 tar: 6.2.1 diff --git a/ts/calling/VideoSupport.ts b/ts/calling/VideoSupport.ts index fa66989b924..a0310772ac5 100644 --- a/ts/calling/VideoSupport.ts +++ b/ts/calling/VideoSupport.ts @@ -307,7 +307,7 @@ export class GumVideoCapturer { const reader = new MediaStreamTrackProcessor({ track, }).readable.getReader(); - const buffer = Buffer.alloc(MAX_VIDEO_CAPTURE_BUFFER_SIZE); + const buffer = new Uint8Array(MAX_VIDEO_CAPTURE_BUFFER_SIZE); this.spawnedSenderRunning = true; // eslint-disable-next-line @typescript-eslint/no-floating-promises (async () => { @@ -397,13 +397,13 @@ export const MAX_VIDEO_CAPTURE_BUFFER_SIZE = MAX_VIDEO_CAPTURE_AREA * 4; export class CanvasVideoRenderer { private canvas?: RefObject; - private buffer: Buffer; + private buffer: Uint8Array; private imageData?: ImageData; private source?: VideoFrameSource; private rafId?: any; constructor() { - this.buffer = Buffer.alloc(MAX_VIDEO_CAPTURE_BUFFER_SIZE); + this.buffer = new Uint8Array(MAX_VIDEO_CAPTURE_BUFFER_SIZE); } setCanvas(canvas: RefObject | undefined): void { diff --git a/ts/calling/useGetCallingFrameBuffer.ts b/ts/calling/useGetCallingFrameBuffer.ts index ff91d56846e..79ebb336303 100644 --- a/ts/calling/useGetCallingFrameBuffer.ts +++ b/ts/calling/useGetCallingFrameBuffer.ts @@ -12,12 +12,12 @@ import { FRAME_BUFFER_SIZE } from './constants.js'; * of allocating one per participant. Be careful when using this buffer elsewhere, as it * is not cleaned up and may hold stale data. */ -export function useGetCallingFrameBuffer(): () => Buffer { - const ref = useRef(null); +export function useGetCallingFrameBuffer(): () => Uint8Array { + const ref = useRef(null); return useCallback(() => { if (!ref.current) { - ref.current = Buffer.alloc(FRAME_BUFFER_SIZE); + ref.current = new Uint8Array(FRAME_BUFFER_SIZE); } return ref.current; }, []); diff --git a/ts/components/GroupCallOverflowArea.stories.tsx b/ts/components/GroupCallOverflowArea.stories.tsx index 67cba7ec487..9da78c28415 100644 --- a/ts/components/GroupCallOverflowArea.stories.tsx +++ b/ts/components/GroupCallOverflowArea.stories.tsx @@ -43,7 +43,7 @@ export default { } satisfies Meta; const defaultProps = { - getFrameBuffer: memoize(() => Buffer.alloc(FRAME_BUFFER_SIZE)), + getFrameBuffer: memoize(() => new Uint8Array(FRAME_BUFFER_SIZE)), getCallingImageDataCache: memoize(() => new Map()), getGroupCallVideoFrameSource: fakeGetGroupCallVideoFrameSource, imageDataCache: React.createRef(), diff --git a/ts/components/GroupCallOverflowArea.tsx b/ts/components/GroupCallOverflowArea.tsx index ebbd42bfd7f..537119169cd 100644 --- a/ts/components/GroupCallOverflowArea.tsx +++ b/ts/components/GroupCallOverflowArea.tsx @@ -17,7 +17,7 @@ const OVERFLOW_SCROLL_BUTTON_RATIO = 0.75; export const OVERFLOW_PARTICIPANT_WIDTH = 107; export type PropsType = { - getFrameBuffer: () => Buffer; + getFrameBuffer: () => Uint8Array; getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource; i18n: LocalizerType; imageDataCache: React.RefObject; diff --git a/ts/components/GroupCallRemoteParticipant.stories.tsx b/ts/components/GroupCallRemoteParticipant.stories.tsx index d71bf8f4dfe..4abe0615c14 100644 --- a/ts/components/GroupCallRemoteParticipant.stories.tsx +++ b/ts/components/GroupCallRemoteParticipant.stories.tsx @@ -32,7 +32,7 @@ type OverridePropsType = { } ); -const getFrameBuffer = memoize(() => Buffer.alloc(FRAME_BUFFER_SIZE)); +const getFrameBuffer = memoize(() => new Uint8Array(FRAME_BUFFER_SIZE)); const createProps = ( overrideProps: OverridePropsType, diff --git a/ts/components/GroupCallRemoteParticipant.tsx b/ts/components/GroupCallRemoteParticipant.tsx index 9f68f516f34..975d04addf6 100644 --- a/ts/components/GroupCallRemoteParticipant.tsx +++ b/ts/components/GroupCallRemoteParticipant.tsx @@ -42,7 +42,7 @@ const DELAY_TO_SHOW_MISSING_MEDIA_KEYS = 5000; const CONTAINER_TRANSITION_TIME = 200; type BasePropsType = { - getFrameBuffer: () => Buffer; + getFrameBuffer: () => Uint8Array; getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource; i18n: LocalizerType; imageDataCache: React.RefObject; diff --git a/ts/test-helpers/fakeGetGroupCallVideoFrameSource.ts b/ts/test-helpers/fakeGetGroupCallVideoFrameSource.ts index 8686d904892..7546c3bfeb4 100644 --- a/ts/test-helpers/fakeGetGroupCallVideoFrameSource.ts +++ b/ts/test-helpers/fakeGetGroupCallVideoFrameSource.ts @@ -32,7 +32,7 @@ class FakeGroupCallVideoFrameSource implements VideoFrameSource { } receiveVideoFrame( - destinationBuffer: Buffer, + destinationBuffer: Uint8Array, _maxWidth: number, _maxHeight: number ): [number, number] | undefined { diff --git a/ts/test-mock/pnp/calling_test.ts b/ts/test-mock/pnp/calling_test.ts index 9413d5f9b35..51013d4e60d 100644 --- a/ts/test-mock/pnp/calling_test.ts +++ b/ts/test-mock/pnp/calling_test.ts @@ -65,7 +65,7 @@ describe('pnp/calling', function (this: Mocha.Suite) { { callMessage: { offer: { - opaque: Buffer.alloc(1), + opaque: new Uint8Array(1), }, }, }, diff --git a/ts/test-node/util/callingMessageToProto_test.ts b/ts/test-node/util/callingMessageToProto_test.ts index ba3ded82bc4..3e7d59a9c5f 100644 --- a/ts/test-node/util/callingMessageToProto_test.ts +++ b/ts/test-node/util/callingMessageToProto_test.ts @@ -44,7 +44,7 @@ describe('callingMessageToProto', () => { it('attaches opaque data', () => { const callingMessage = new CallingMessage(); callingMessage.opaque = new OpaqueMessage(); - callingMessage.opaque.data = Buffer.from([1, 2, 3]); + callingMessage.opaque.data = new Uint8Array([1, 2, 3]); const result = callingMessageToProto(callingMessage); @@ -74,7 +74,7 @@ describe('callingMessageToProto', () => { it('attaches urgency and opaque data if both are provided', () => { const callingMessage = new CallingMessage(); callingMessage.opaque = new OpaqueMessage(); - callingMessage.opaque.data = Buffer.from([1, 2, 3]); + callingMessage.opaque.data = new Uint8Array([1, 2, 3]); const result = callingMessageToProto( callingMessage, diff --git a/ts/util/callingMessageToProto.ts b/ts/util/callingMessageToProto.ts index f5d01c7de6e..1198686f742 100644 --- a/ts/util/callingMessageToProto.ts +++ b/ts/util/callingMessageToProto.ts @@ -27,7 +27,7 @@ export function callingMessageToProto( if (opaque) { opaqueField = { ...opaque, - data: bufferToProto(opaque.data), + data: opaque.data, }; } if (urgency !== undefined) { @@ -43,14 +43,14 @@ export function callingMessageToProto( ...offer, id: Long.fromValue(offer.callId), type: offer.type as number, - opaque: bufferToProto(offer.opaque), + opaque: offer.opaque, } : undefined, answer: answer ? { ...answer, id: Long.fromValue(answer.callId), - opaque: bufferToProto(answer.opaque), + opaque: answer.opaque, } : undefined, iceUpdate: iceCandidates @@ -58,7 +58,7 @@ export function callingMessageToProto( return { ...candidate, id: Long.fromValue(candidate.callId), - opaque: bufferToProto(candidate.opaque), + opaque: candidate.opaque, }; }) : undefined, @@ -80,19 +80,6 @@ export function callingMessageToProto( }; } -function bufferToProto( - value: Uint8Array | { toArrayBuffer(): ArrayBuffer } | undefined -): Uint8Array | undefined { - if (!value) { - return undefined; - } - if (value instanceof Uint8Array) { - return value; - } - - return new Uint8Array(value.toArrayBuffer()); -} - function urgencyToProto( urgency: CallMessageUrgency ): Proto.CallMessage.Opaque.Urgency { diff --git a/ts/util/lint/exceptions.json b/ts/util/lint/exceptions.json index d9dcafbb287..2a5f12ac07b 100644 --- a/ts/util/lint/exceptions.json +++ b/ts/util/lint/exceptions.json @@ -828,9 +828,9 @@ { "rule": "React-useRef", "path": "ts/calling/useGetCallingFrameBuffer.ts", - "line": " const ref = useRef(null);", + "line": " const ref = useRef(null);", "reasonCategory": "usageTrusted", - "updated": "2021-12-10T23:24:03.829Z", + "updated": "2025-10-01T20:11:56Z", "reasonDetail": "Doesn't touch the DOM." }, {