fix: tighten edge cases across services (#3158)

This commit is contained in:
Hampus
2026-10-03 13:04:29 +02:00
committed by GitHub
parent a9f7a23c0d
commit 4e6b837ccc
170 changed files with 2028 additions and 421 deletions
@@ -307,7 +307,7 @@ describe('ensureVideoDDExtension', () => {
expect(ddOf(sdp, '1')).toBe(13);
});
it('leaves a section that already carries the extension alone', () => {
it('leaves a section that already has the extension alone', () => {
const sdp = parse(`${singlePcOffer}\na=extmap:3 ${ddExtensionURI}`);
expect(ensureVideoDDExtension(sectionOf(sdp, '2'), sdp, 0)).toBe(3);
expect(sectionOf(sdp, '2').ext).toHaveLength(2);
@@ -214,7 +214,7 @@ describe('publisher data channels before negotiation', () => {
return {engine, created};
}
it('creates them on a renegotiation that already carries transceivers', async () => {
it('creates them on a renegotiation that already has transceivers', async () => {
const {engine, created} = engineWithPublisherChannels(false);
await engine.negotiate();
expect(created).toEqual(['publisher']);
@@ -44,7 +44,7 @@ export type SetupUnauthorizedCause = 'stale_session' | 'origin_mismatch' | 'unkn
export async function classifySetupUnauthorized(): Promise<SetupUnauthorizedCause> {
if (!SessionManager.token) return 'unknown';
if (!http.carriesAuthorization()) return 'origin_mismatch';
if (!http.hasAuthorization()) return 'origin_mismatch';
try {
const response = await http.get(Endpoints.USER_ME, {mode: 'silent'});
return response.status === 401 ? 'stale_session' : 'unknown';
@@ -42,7 +42,7 @@ const ToggleGroupSubmenu: React.FC<{group: ToggleGroup}> = observer(({group}) =>
data-flx="channel.channel-header-components.developer-tools-context-menu.toggle-group-submenu.checkbox-item"
>
{description ? (
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: project policy forbids the native title attribute, so aria-label carries the description on the developer-options row
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: project policy forbids the native title attribute, so aria-label holds the description on the developer-options row
<span
aria-label={translateDescriptor(i18n, description)}
data-flx="channel.channel-header-components.developer-tools-context-menu.toggle-group-submenu.span"
@@ -157,7 +157,7 @@ describe('ExperimentAssignments response handling', () => {
expect(ExperimentAssignments.response).toEqual(CANARY_ENVELOPE);
});
it('accepts an envelope that carries no domain migration assignment', async () => {
it('accepts an envelope that has no domain migration assignment', async () => {
await adopt({poll_interval_seconds: 600, poll_jitter_percent: 0, assignments: {}});
expect(ExperimentAssignments.response.assignments.domain_migration).toBeUndefined();
expect(lastScheduledDelayMs()).toBe(600_000);
@@ -387,7 +387,7 @@ describe('ExperimentAssignments lifecycle', () => {
expect(vi.mocked(http.get)).toHaveBeenCalledTimes(1);
});
it('does not carry the etag or the backoff of the previous session across a reset', async () => {
it('does not keep the etag or the backoff of the previous session across a reset', async () => {
vi.spyOn(Math, 'random').mockReturnValue(0.5);
await adopt(CANARY_ENVELOPE);
vi.mocked(http.get).mockResolvedValue(reply(500, {message: '500: Internal Server Error'}));
@@ -110,7 +110,7 @@ function readProxyDimensionParam(url: URL, key: 'width' | 'height'): number | un
return resolveProxyDimension(Number(raw));
}
function carriedProxyDimensions(proxyURL: string): {width?: number; height?: number} | undefined {
function proxyUrlDimensions(proxyURL: string): {width?: number; height?: number} | undefined {
let parsed: URL;
try {
parsed = new URL(proxyURL);
@@ -124,7 +124,7 @@ function carriedProxyDimensions(proxyURL: string): {width?: number; height?: num
}
function variantDimensions(proxyURL: string, width?: number, height?: number): {width?: number; height?: number} {
return carriedProxyDimensions(proxyURL) ?? {width, height};
return proxyUrlDimensions(proxyURL) ?? {width, height};
}
export function stripMediaProxyParams(proxyURL: string): string {
@@ -177,7 +177,7 @@ export class RestClient {
this.state.globalIntercept = hooks.intercept;
}
carriesAuthorization(): boolean {
hasAuthorization(): boolean {
return !isOffOrigin(resolveUrl(this.state, '/', undefined));
}
@@ -582,7 +582,7 @@ describe('ReadStates private channel open, close and reopen', () => {
});
});
it("characterisation: acks the current user's message that CHANNEL_CREATE already carries", () => {
it("characterisation: acks the current user's message that CHANNEL_CREATE already includes", () => {
ready([], []);
channelCreate(dm(CHANNEL.newDm, MESSAGE.own));
messageCreate(wireMessage(MESSAGE.own, CHANNEL.newDm, ME));
@@ -436,7 +436,7 @@ const QuickSwitcherModalComponent: React.FC = observer(() => {
text={i18n._(QUICK_SWITCHER_DESCRIPTOR)}
data-flx="search.quick-switcher.quick-switcher-modal.quick-switcher-modal-component.modal-screen-reader-label"
/>
{/* biome-ignore lint/a11y/noStaticElementInteractions: pointer arbitration surface for the result rows; it carries no affordance of its own. */}
{/* biome-ignore lint/a11y/noStaticElementInteractions: pointer arbitration surface for the result rows; it has no affordance of its own. */}
<div
className={quickStyles.container}
onMouseMove={handlePointerMove}
@@ -73,7 +73,7 @@ function watchBackdropActivation(ownerDocument: Document): () => void {
};
}
function isBackdropActivationCarriedOver(ownerDocument: Document): boolean {
function isBackdropActivationLeftOver(ownerDocument: Document): boolean {
const watcher = backdropActivationWatchers.get(ownerDocument);
if (!watcher) {
return false;
@@ -222,7 +222,7 @@ export function useModalLogic({
}, [handleClose, modalKey]);
const handleBackdropClick = useCallback(
(customOnClose?: () => void) => {
if (isBackdropActivationCarriedOver(ownerDocument)) {
if (isBackdropActivationLeftOver(ownerDocument)) {
return;
}
handleClose(customOnClose);
@@ -90,6 +90,7 @@ type UserUpdatePayload = Partial<UserPrivate> & {
};
type UserUpdateResponse = UserPrivate & {
token?: string;
auth_session_id_hash?: string;
};
interface HarvestRequestResponse {
@@ -203,6 +204,11 @@ export async function update(user: UserUpdatePayload): Promise<UserUpdateRespons
logger.debug(`Updated fields: ${updatedFields.join(', ')}`);
}
if (userData.token) {
SessionManager.setToken(userData.token);
GatewayConnection.setToken(userData.token);
if (userData.auth_session_id_hash) {
AuthSession.handleAuthSessionChange(userData.auth_session_id_hash);
}
logger.debug('Authentication token was refreshed');
}
return userData;
@@ -23,7 +23,7 @@ function collectFailureViolations(snapshot: VoiceMediaGraphSnapshot, violations:
if (!failure.streamKey) continue;
const currentGeneration = snapshot.watchGenerationByStreamKey.get(failure.streamKey) ?? 0;
if (failure.generation <= currentGeneration) continue;
violations.push(`failure ${key} carries generation ${failure.generation} newer than current ${currentGeneration}`);
violations.push(`failure ${key} has generation ${failure.generation} newer than current ${currentGeneration}`);
}
}
@@ -52,7 +52,7 @@ describe('screen share layering', () => {
}
});
it('keeps temporal layers for the SVC codecs that carry one', () => {
it('keeps temporal layers for the SVC codecs that have one', () => {
for (const codec of ['av1', 'vp9'] as const) {
expect(resolveScreenShareLayering({codec, svcSetting: 'auto'}).scalabilityMode).toBe('L1T3');
}
@@ -126,7 +126,7 @@ describe('formatScreenShareTargetLabel', () => {
});
describe('SCREEN_SHARE_STATUS_SOURCE_RESOLUTION_DESCRIPTOR', () => {
it('reads Source, carries a translator comment and keeps the wording plain', () => {
it('reads Source, has a translator comment and keeps the wording plain', () => {
expect(SCREEN_SHARE_STATUS_SOURCE_RESOLUTION_DESCRIPTOR.message).toBe('Source');
expect(SCREEN_SHARE_STATUS_SOURCE_RESOLUTION_DESCRIPTOR.comment).toEqual(expect.stringMatching(/\S/));
expect(SCREEN_SHARE_STATUS_SOURCE_RESOLUTION_DESCRIPTOR.message).not.toMatch(/[;:—–]/);