Stuck on receive metadata stage

I’m stuck on Stage #(change to your stage, ex. #ZH1
I have noticed that I am not getting the metadata response, and also noticed that there is an asterisk in what I have sent from my end.

Here are my logs:

[tester::#ZH1] Received payload: *d8:msg_typei0e5:piecei0ee
[tester::#ZH1] Sending metadata response
[tester::#ZH1] timed out, test exceeded 10 seconds
[tester::#ZH1] Test failed

And here’s a snippet of my code:


      const reqMetaData = Buffer.alloc(4 + 1 + 1 + reqMetaDict.length)
        reqMetaData.writeUInt32BE(2 + reqMetaDict.length, 0)
        reqMetaData.writeUInt8(20, 4)
        reqMetaData.writeUInt8(metaDataDict['m'].ut_metadata, 5)
        reqMetaDict.copy(reqMetaData, 6)

            console.log("reqMetadata", reqMetaData)
        this.peerCommunication.sendMessage(reqMetaData)

        const data = await this.peerCommunication.waitForExtensionData()
        console.log("data", data)

        this.peerCommunication.endConnection()




Hey @abhishek-7901, I tried running your code against the previous stages, but it’s actually no longer passing a previous stage #PK2 (Magnet Links - Announce extension support).

Suggestions:

  1. Use our CLI to test against previous stages by running:
codecrafters test --previous
  1. Focus on fixing the early stages first, as later stages depend on them.

I have done that, but the previous stage is not going to pass now because before I was only waiting for the dictionary now I am waiting for metadata piece contents as well which is not getting received

Got it! Let me know if you’d like assistance with the earlier stages too. It’s generally best to get previous stages working properly before focusing on the latest one.

yes I have sorted it, I am still not able to receive the metadata contents Andy
can you have a look at that


not able to receive this part is the issue I am facing

@abhishek-7901 I added a couple of logs here:

I’m not quite sure why the comparison extId === this.ut_metadata is needed:

oh since I communicated with the peer that my id for ut_metadata is 1, it would send 1 isn’t.

Makes sense, I was comparing it with what the peer was using as the number

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.