Skip to content

fix: allow publish to topic without sender #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

mattjohnsonpint
Copy link
Collaborator

@mattjohnsonpint mattjohnsonpint commented Jun 10, 2025

Publishing a message from an actor to a topic works fine:

err := senderActorPid.Tell(ctx, topicActorPid, publishMessage)

But publishing anonymously was creating a panic that would shut down the actor system:

import goakt "github.com/tochemey/goakt/v3/actor"

...

err := goakt.Tell(ctx, topicActorPid, publishMessage)

The panic was due to ctx.Sender() being nil in the handlePublish method.

Fixed. Copied and modified one of the existing test, which would fail without the fix but now passes.

@mattjohnsonpint

This comment was marked as resolved.

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.02%. Comparing base (e148d09) to head (2699566).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #761      +/-   ##
==========================================
- Coverage   88.12%   88.02%   -0.10%     
==========================================
  Files         101      101              
  Lines        8780     8783       +3     
==========================================
- Hits         7737     7731       -6     
- Misses        819      826       +7     
- Partials      224      226       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Owner

@Tochemey Tochemey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@Tochemey Tochemey merged commit 4eaca4b into Tochemey:main Jun 11, 2025
12 of 15 checks passed
@mattjohnsonpint mattjohnsonpint deleted the topic-actor branch June 11, 2025 17:48
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