Skip to content

Backport worker_may_ignore history handling#356

Open
d2army wants to merge 2 commits intotransfers-masterfrom
ian-yap/backport-worker-may-ignore-0-0-7
Open

Backport worker_may_ignore history handling#356
d2army wants to merge 2 commits intotransfers-masterfrom
ian-yap/backport-worker-may-ignore-0-0-7

Conversation

@d2army
Copy link
Copy Markdown

@d2army d2army commented May 9, 2026

Summary

  • Backport worker_may_ignore history handling from the 0.1.x line to transfers-master / 0.0.x without proto regeneration.
  • Make History::Event constructable when a history event has an attributes oneof unknown to the old generated proto, so worker_may_ignore can still be read.
  • Ignore known Nexus/options-updated events and unknown worker-ignorable events while preserving fail-closed behavior for non-ignorable unknown events.
  • Prepare the 0.0.7 release with a version bump and changelog entry.

Why (#1)

  • Temporal Cloud can attach new Nexus/options-updated history events that older 0.0.x Ruby workers do not understand.
  • On the 0.0.x line, History::Event#extract_attributes can receive nil for an unknown attributes oneof and raise before worker_may_ignore is read; making attribute extraction nil-safe keeps the compatibility bit reachable.

Why (#2)

  • StateManager#apply_event calls History::EventTarget.from_event(event) before its event-type case statement, so unknown event prefixes can raise before the final unsupported-event branch is reached.
  • This backport adds the upstream ignore paths for known safe event types and for unknown events marked worker_may_ignore=true, while still raising for unknown events that are not explicitly safe to ignore.

Test plan

  • RBENV_VERSION=3.0.6 bundle exec rspec -r temporal/connection/grpc spec/unit/lib/temporal/workflow/history/event_spec.rb spec/unit/lib/temporal/workflow/state_manager_spec.rb
  • RBENV_VERSION=3.0.6 ruby -c lib/temporal/version.rb && RBENV_VERSION=3.0.6 ruby -c spec/unit/lib/temporal/workflow/history/event_spec.rb && git diff --check

Follow-up validation

  • Replay-history fixture coverage is intentionally deferred; this PR keeps the hotfix backport focused on unit coverage for the new state-manager paths plus a cross-schema protobuf decode case.
  • Before server-side rollout, Coinbase consumers should validate 0.0.7 with a bundle update and worker/workflow smoke tests.

d2army and others added 2 commits May 9, 2026 10:35
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant