fix: various fixes to things + simply app proxy sentry setup

This commit is contained in:
Hampus Kraft
2026-02-19 00:29:58 +00:00
parent ff1d15f7aa
commit 528e4e0d7f
44 changed files with 441 additions and 1042 deletions

View File

@@ -219,6 +219,37 @@ describe('Fluxer Markdown Parser', () => {
]);
});
test('timestamp at max js date boundary parses', () => {
const input = '<t:8640000000000>';
const parser = new Parser(input, 0);
const {nodes: ast} = parser.parse();
expect(ast).toEqual([
{
type: NodeType.Timestamp,
timestamp: 8640000000000,
style: TimestampStyle.ShortDateTime,
},
]);
});
test('timestamp above max js date boundary does not parse', () => {
const input = '<t:8640000000001>';
const parser = new Parser(input, 0);
const {nodes: ast} = parser.parse();
expect(ast).toEqual([{type: NodeType.Text, content: input}]);
});
test('timestamp that overflows to infinity does not parse', () => {
const largeDigits = '9'.repeat(400);
const input = `<t:${largeDigits}>`;
const parser = new Parser(input, 0);
const {nodes: ast} = parser.parse();
expect(ast).toEqual([{type: NodeType.Text, content: input}]);
});
test('timestamp with leading zeros', () => {
const input = '<t:0001618953630>';
const flags = 0;

View File

@@ -58,6 +58,15 @@ export function parseTimestamp(text: string): ParserResult | null {
return null;
}
const timestampMillis = timestamp * 1000;
if (!Number.isFinite(timestampMillis)) {
return null;
}
if (Number.isNaN(new Date(timestampMillis).getTime())) {
return null;
}
let style: TimestampStyle;
if (stylePart !== undefined) {
if (stylePart === '') {