Skip to content

Conversation

@jpradass
Copy link
Contributor

@jpradass jpradass commented Apr 21, 2025

Motivation / Background

I was having issues testing the application using default marshaller and setting the whole thing up as a subscriber listening to a topic and trying to send messages using redis-cli by hand. The thing is that I wasn't sending any uuid header and there wasn't an explicit error in the code to let me know what was happening so I added because I think it is for a better understanding to everyone who try this application that way.

Details

Inside marshaller.go archive, the one that is used as a DefaultMarshaller, inside Unmarshall function, there was an explicit conversion of an interface type variable to a string for an UUID header value and also the payload of the message. I know the marshaller is really basic and it is advisable to use a custom one but I think is clearer for testing purposes if it is added a little if as a check to see if UUID header has been sent in order to warn the user if not and to give "payload" a base value in case it is empty because it will panic otherwise because of a forced nil conversion into a string value.

Alternative approaches considered (if applicable)

Checklist

The resources of our team are limited. There are a couple of things that you can do to help us merge your PR faster:

  • I wrote tests for the changes.
  • All tests are passing.
    • If you are testing a Pub/Sub, you can start Docker with make up.
    • You can start with make test_short for a quick check.
    • If you want to run all tests, use make test.
  • Code has no breaking changes.
  • (If applicable) documentation on watermill.io is updated.

@minghsu0107
Copy link
Collaborator

The additional check looks good to me, thank you!

@minghsu0107 minghsu0107 merged commit b9bac80 into ThreeDotsLabs:main Apr 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants