greenart7c3 / Amber

MIT License
92 stars 5 forks source link

nip46 error should not be `null` #38

Closed alexgleason closed 1 month ago

alexgleason commented 1 month ago

It is possible for Amber to send a response like:

{"error":null,"id":"23af55b0-698c-4150-a56a-9a508c658ce3","result":"ack"}

This causes my serializer to crash:

error: Uncaught (in promise) ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "null",
    "path": [
      "error"
    ],
    "message": "Expected string, received null"
  }
]

The result should look like this (error is omitted):

{"id":"23af55b0-698c-4150-a56a-9a508c658ce3","result":"ack"}
greenart7c3 commented 1 month ago

We should change the nip text too

alexgleason commented 1 month ago

Fixed by 518a610c92d6bc61bdc8a0ea106b9215aba1f0f2

@greenart7c3 Can you do a release please? Thank you for fixing these! :clap:

greenart7c3 commented 1 month ago

Sure, i'll make a release later