From 85faa4ac908dab25fb1815f597ce8b5dbaddb910 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Sat, 8 Nov 2025 11:05:51 +0100 Subject: [PATCH] Change connection ID to 6-digit hex string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate random 6-digit hex IDs (e.g., A3F2C1) instead of timestamp-based IDs (e.g., conn-1762596287521) for cleaner, more user-friendly connection codes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/App.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 7cafe40..ba0af1d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -26,6 +26,11 @@ const client = new RondevuClient({ baseUrl: 'https://rondevu.xtrdev.workers.dev' }); +// Generate a random 6-digit hex string +function generateConnectionId() { + return Math.floor(Math.random() * 0xFFFFFF).toString(16).padStart(6, '0').toUpperCase(); +} + function App() { // Step-based state const [step, setStep] = useState(1); // 1: action, 2: method, 3: details, 4: connected @@ -149,12 +154,12 @@ function App() { if (action === 'create') { if (method === 'connection-id') { - connId = connectionId || `conn-${Date.now()}`; + connId = connectionId || generateConnectionId(); connection = await rdv.create(connId, topic || 'default'); setCurrentConnectionId(connId); log(`Created connection: ${connId}`, 'success'); } else { - connId = `conn-${Date.now()}`; + connId = generateConnectionId(); connection = await rdv.create(connId, topic); setCurrentConnectionId(connId); log(`Created connection: ${connId}`, 'success');