Skip to content
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

Uniformize event_ts support on inner events #1052

Merged

Conversation

abustany
Copy link
Contributor

@abustany abustany commented Apr 8, 2022

This PR adds uniform support for the event_ts field on all inner events, fixing #1051 . It includes two breaking changes, but I consider those optional and would be happy with only merging the first commit.

The two breaking changes are the following

  1. Rename WorkflowStepExecuteEvent.EventTS to EventTimestamp. I did a "brutal" rename, but if backwards compatibility is an issue we could also investigate keeping both fields and have custom MarshalJSON/UnmarshalJSON functions, though this also opens weird questions like "what do we do when serializing if both are set?".
  2. Change all EventTimestamp fields to be strings, and not json.Number. We're not worried about losing precision here since json.Number is actually a string, but it seems (cf. The value contained message_ts in LinkShared event is not only a timestamp #998) that this field had to be switched to a string for couple of events already, and having an inconsistent type here feels a bit weird.

… other events

The fields used to be called EventTS, but WorkflowStepExecuteEvent was
the only event struct with such a field.
This field should always be stored/used as a string according to [1].
This also makes the type more consistent across events.

[1] slackhq/slack-api-docs#7 (comment)
Copy link
Member

@kanata2 kanata2 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@kanata2 kanata2 added this to the v0.11.0 milestone Apr 16, 2022
@kanata2 kanata2 merged commit 8d2ed5e into slack-go:master Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants