[Bug] Testing::ActivityEnvironment adds detail_hints to heartbeat details
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from temporalio/sdk-ruby
-
[Bug] JSON payload decoding raises ArgumentError with json 3.x (JSON.parse options are keyword-only)Possibly taken @GregoryTravis claimed this 4 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
temporalio/sdk-ruby#595 · 4 comments · 2 assignees ·
Maintainers usually reply within 1 day
-
Enable concurrent payload visiting - RubyPossibly taken @jmaeagle99 claimed this 4 days ago. Open
temporalio/sdk-ruby#616 · 1 assignee ·
Maintainers usually reply within 1 day
-
External Payload Storage Foundation - RubyPossibly taken @jmaeagle99 claimed this 8 days ago. Open
temporalio/sdk-ruby#614 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug] Exception in an unawaited Workflow::Future is silently swallowed, leaving the workflow stuck RUNNINGPossibly taken @GregoryTravis claimed this 4 days ago. Openbug
Difficulty 3/5 Half a day Newbie friendliness 40/100
temporalio/sdk-ruby#613 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
-
Proposal: handle SIGTERM by default to initiate graceful worker shutdownPossibly taken @eamsden claimed this 9 days ago. Open
temporalio/sdk-ruby#611 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in temporalio/sdk-ruby
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
zerocracy/judges-action#2803 ·
Maintainers usually reply within 5 days
-
empty tone.rbOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
-
enhancement good first issue
Difficulty 2/5 Half a day Newbie friendliness 92/100
r-uby-dev/llm#296 · 2 comments ·
Maintainers usually reply within 1 day
-
Again Fix typo in comment in formatOnboardingAlertMessage [File :- course utils]Possibly taken @ThakuraAnki claimed this today. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 95/100
WikiEducationFoundation/WikiEduDashboard#7158 · 1 comment ·
Maintainers usually reply within 1 day