From fe376f8aa69eb1ddc70c73c3a6febc9d302e4550 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 18 Jul 2026 22:10:54 +0300 Subject: [PATCH] refactor: rename trip dispatch socket event to trip offer and update corresponding listener to trip:update --- backend/e2e-tester/simulation.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/e2e-tester/simulation.js b/backend/e2e-tester/simulation.js index 0956faa..f003b64 100644 --- a/backend/e2e-tester/simulation.js +++ b/backend/e2e-tester/simulation.js @@ -73,9 +73,9 @@ async function run() { driverSocket.on('connect', () => console.log('\x1b[36m[Driver WS] Connected to Gateway\x1b[0m')); riderSocket.on('connect', () => console.log('\x1b[36m[Rider WS] Connected to Gateway\x1b[0m')); - driverSocket.on('trip:dispatch', async (data) => { - console.log(`\n\x1b[35m[Driver WS] 🔔 RECEIVED DISPATCH for Trip ${data.tripId || data.id}!\x1b[0m`); - console.log(`Dispatch Payload:`, JSON.stringify(data, null, 2)); + driverSocket.on('trip:offer', async (data) => { + console.log(`\n\x1b[35m[Driver WS] 🔔 RECEIVED OFFER for Trip ${data.tripId || data.id}!\x1b[0m`); + console.log(`Offer Payload:`, JSON.stringify(data, null, 2)); tripId = data.tripId || data.id; try { @@ -87,7 +87,7 @@ async function run() { } }); - riderSocket.on('trip:updated', (data) => { + riderSocket.on('trip:update', (data) => { console.log(`\x1b[33m[Rider WS] Trip status updated: ${data.status}\x1b[0m`); }); @@ -143,7 +143,7 @@ async function run() { console.error(`\x1b[31m[Simulation Error] ${e.message}\x1b[0m`); } } else { - console.log(`\n\x1b[31mFailed to receive dispatch!\x1b[0m`); + console.log(`\n\x1b[31mFailed to receive offer!\x1b[0m`); console.log(`[Hint] Check if offeredDrivers was 0. If it was 0, the backend didn't find the driver in Redis. If it was > 0, the backend emitted the socket event but the driver didn't receive it.\n`); }