Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug] Testing::ActivityEnvironment adds detail_hints to heartbeat details

Open Beginner friendly
#625 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby
Domain
backend, testing

Research direction

Start with Temporalio::Testing::ActivityEnvironment#on_heartbeat and the context it installs, comparing its heartbeat signature with Temporalio::Activity::Context#heartbeat. Add or run a focused unit test using the provided detail_hints: [:some_hint] reproduction, then verify on_heartbeat receives only [['progress']] while hints still reach the real converter path.

Written by the indexing model from the issue text.

Description

What are you really trying to do?

Unit test an activity that heartbeats with converter hints, using Temporalio::Testing::ActivityEnvironment and on_heartbeat.

Describe the bug

Activity::Context#heartbeat is declared as heartbeat(*details, detail_hints: nil). The context that ActivityEnvironment installs declares heartbeat(*details) with no keyword parameters, so Ruby passes the keyword as a trailing positional Hash. on_heartbeat then receives the hints as an extra detail. Under a real worker, the hints go to the converter and are not recorded as details.

Minimal reproduction
class MyActivity < Temporalio::Activity::Definition
  def execute
    Temporalio::Activity::Context.current.heartbeat('progress', detail_hints: [:some_hint])
  end
end

details = []
env = Temporalio::Testing::ActivityEnvironment.new(on_heartbeat: proc { |d| details << d })
env.run(MyActivity)
p details
# Expected: [["progress"]]
# Actual:   [["progress", {detail_hints: [:some_hint]}]]
Environment/versions
  • SDK version: main (1.9.0)
  • Ruby 3.4, Linux x86_64
Dominant language
Ruby
Stars
207
Forks
44
Avg merge
2d 42m
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from temporalio/sdk-ruby

All issues in temporalio/sdk-ruby

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.