Potential Issues:
  • In the file backend/explorer/validators/urls.py, the validate_url function might raise an exception if the URL is not valid. It would be good to handle this exception gracefully.
  • In the file backend/explorer/tasks/update_metadata.py, the update_metadata function makes an HTTP request without handling potential exceptions that might occur during the request. It might be beneficial to add error handling here.
  • In the file backend/nostr_relay_explorer/settings.py, sensitive information like secret keys and database credentials might be exposed. It's recommended to use environment variables or a separate configuration file to store such information securely.
  1. Fair! But I think that it'll raise a HTTP 400 error which is exactly the error to send to the frontend to handle. It even tells the frontend which field needs to be fixed and the specific error on that field. Django does some great work here.
  2. Agreed it could use some more robust error handling, but the several places that call update_metadata do have try except blocks around them to process any errors and re-raise if appropriate.
  3. Totally, I am using env variables the defaults there are just the values that are used in development (they match how the db is set up via docker-compose). The only one I see that's set that could be an issue is the Django Secret Key, which is only important for encrypted fields which I don't think there are any in this data model.
I'll definitely be making improvements but thanks for taking the time to look through it!
reply