Guard pairing token renewal against concurrent edits and cap pairing names

This commit is contained in:
Chris Scott committed 2026-11-28 20:36:48 -05:00
1 parent 3c7bc80988
commit 12dab07b87
4 files changed
+65 -3

No files matched your search

@@ -130,6 +130,16 @@ describe('parseOpenCodeConnectLink', () => {
})
})
it('caps a long QR payload name to the create request maximum', () => {
const payload = JSON.stringify({
code: 'abc',
urls: ['https://abc.def.opentunnel.xyz'],
name: 'n'.repeat(150),
})
expect(parseOpenCodeConnectLink(payload)?.name).toBe('n'.repeat(100))
})
it.each([
['no urls', JSON.stringify({ code: 'abc', urls: [] })],
['a non-string url', JSON.stringify({ code: 'abc', urls: [42] })],