debug: Add detailed logging for handshake sp_address

**Motivations :**
- Debug why sp_address is empty in handshake message
- Understand why relay readiness check fails

**Modifications :**
- Added detailed logging in handleHandshakeMsg to inspect sp_address
- Added warning when sp_address is empty or undefined

**Pages affectées :**
- src/services/service.ts - Enhanced handshake debugging
This commit is contained in:
NicolasCantu 2025-10-23 19:13:30 +02:00
parent bec3ab1729
commit c21de2b943

View File

@ -2109,10 +2109,20 @@ export default class Services {
public async handleHandshakeMsg(url: string, parsedMsg: any) { public async handleHandshakeMsg(url: string, parsedMsg: any) {
try { try {
const handshakeMsg: HandshakeMessage = JSON.parse(parsedMsg); const handshakeMsg: HandshakeMessage = JSON.parse(parsedMsg);
console.log('🔍 DEBUG: Handshake message received:', {
url,
hasSpAddress: !!handshakeMsg.sp_address,
spAddress: handshakeMsg.sp_address,
spAddressType: typeof handshakeMsg.sp_address,
spAddressLength: handshakeMsg.sp_address?.length
});
if (handshakeMsg.sp_address) { if (handshakeMsg.sp_address) {
this.updateRelay(url, handshakeMsg.sp_address); this.updateRelay(url, handshakeMsg.sp_address);
this.relayAddresses[url] = handshakeMsg.sp_address; this.relayAddresses[url] = handshakeMsg.sp_address;
this.resolveRelayReady(); this.resolveRelayReady();
} else {
console.warn('⚠️ Handshake received but sp_address is empty or undefined');
} }
console.log('handshakeMsg:', handshakeMsg); console.log('handshakeMsg:', handshakeMsg);