Skip to content

Preserve channel data in block action payloads - #489

Open
alloutflo wants to merge 1 commit into
HubSpot:masterfrom
alloutflo:fix/139-block-action-channel
Open

alloutflo wants to merge 1 commit into
HubSpot:masterfrom
alloutflo:fix/139-block-action-channel

Conversation

@alloutflo

Copy link
Copy Markdown

A block_actions payload containing "channel": {"id": "C123", "name": "general"} currently deserializes with getChannel() == null, including when read as SlackInteractiveCallback. This is reproducible by adding that field to the existing block_actions_with_message_container.json fixture; the new regression failed on the current master before the fix.

Mark the existing default getter with @Default and @Nullable so Immutables stores the supplied channel. Both channel ID and name now survive deserialization and serialization. The getter signature and default implementation remain unchanged for custom implementations. Missing or explicit-null channels remain accepted and omitted from serialized payloads, consistent with Slack's optional channel field. No channel is inferred from container.channel_id.

Validation under Temurin 21.0.13:

  • Regression verified failing before the fix; all 10 BlockActionsSerializationTest tests pass afterward, covering direct/polymorphic roundtrips, absent/null channels, and builder copies.
  • mvn -B -q clean install: 400 tests, 0 failures/errors, 3 existing skips (baseline: 395 tests, the same 3 skips).
  • mvn -B -q spotless:check and git diff --check pass.
  • Maven commands use -t ../toolchains/toolchains.xml locally to select the installed JDK. No project toolchain, dependency, version, generated-source, or CI files change.

AI assistance: implemented and tested with OpenAI Codex, with a separate diff review.

Fixes #139

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.

BlockActionsIF.channel should not be null

1 participant