Compare commits

..

No commits in common. "a72ca7dcf42e3fd30722b48c66921cc02ecd85a3" and "a97b5921c91154464e79cebe4ca53c4d3e3d473e" have entirely different histories.

2 changed files with 6 additions and 7 deletions

View file

@ -5,7 +5,6 @@
import { target } from "happy-dom/lib/PropertySymbol.js";
import { toASCII } from "node:punycode";
import * as bull from "bullmq";
export type Obj = { [x: string]: any };
export type ApObject = IObject | string | (IObject | string)[];
@ -82,11 +81,11 @@ export function yumeNormalizeURL(url: string): string {
u.hash = '';
u.host = toASCII(u.host);
if (u.protocol && u.protocol !== 'https:') {
throw new bull.UnrecoverableError('protocol is not https');
throw new Error('protocol is not https');
}
u.protocol = 'https:';
if (u.port && u.port !== '443') {
throw new bull.UnrecoverableError('port is not 443');
throw new Error('port is not 443');
}
return u.toString();
}
@ -94,7 +93,7 @@ export function yumeNormalizeURL(url: string): string {
export function yumeNormalizeRecursive<O extends IUnsanitizedObject | string | (IUnsanitizedObject | string)[]>(object: O, depth = 0):
IObject | string | (IObject | string)[] {
if (depth > 16) {
throw new bull.UnrecoverableError('recursion limit exceeded');
throw new Error('recursion limit exceeded');
}
if (typeof object === 'string') {
@ -102,7 +101,7 @@ export function yumeNormalizeRecursive<O extends IUnsanitizedObject | string | (
}
if (Array.isArray(object)) {
if (object.length > 64) {
throw new bull.UnrecoverableError('array length limit exceeded');
throw new Error('array length limit exceeded');
}
return object.flatMap(yumeNormalizeRecursive);
}

View file

@ -67,7 +67,7 @@ const mIncomingApReject = metricCounter({
const mincomingApProcessingError = metricCounter({
name: 'misskey_incoming_ap_processing_error',
help: 'Incoming AP processing error',
labelNames: ['incoming_host', 'incoming_type'],
labelNames: ['incoming_host', 'incoming_type', 'reason'],
});
@Injectable()
@ -307,7 +307,7 @@ export class InboxProcessorService implements OnApplicationShutdown {
}
const end = +new Date();
observeHistogram(mIncomingApProcessingTime, { success: 'false' }, (end - begin) / 1000);
incCounter(mincomingApProcessingError, {});
incCounter(mincomingApProcessingError, { reason: 'unknown' });
throw e;
}
observeHistogram(mIncomingApProcessingTime, { success: 'true' }, (+new Date() - begin) / 1000);