slack icon indicating copy to clipboard operation
slack copied to clipboard

API returns int64 for "timestamp" in RichTextSectionDateElement.

Open rusq opened this issue 3 years ago • 1 comments

What happened

API returns timestamp as int64 type for "RichTextSectionDateElement" and json parsing fails.

Expected behavior

The API response is correctly Unmarshalled into RichTextSectionDateElement.

Steps to reproduce

Attached is the archive with the API output and a main.go program that, if executed, reproduces the error.

The attached archive contains also bug119-r.json which is the raw output from the API with the PII removed.

reproducible code

rich_text_date_issue.zip

manifest.yaml

manifest WHO?

Versions

  • Go: go version go1.19 darwin/amd64
  • slack-go/slack: v0.11.2

Comments

I'm not sure how to go about this - has there been an instance where timestamp is string for this RichText block element?

Original issue link: https://github.com/rusq/slackdump/issues/119

rusq avatar Aug 29 '22 11:08 rusq

Possibly JSONTime will do the trick? (an additional branch for when input is a number would be needed)

rusq avatar Aug 29 '22 11:08 rusq

Hey team, any chance this can be looked at?

rusq avatar Oct 22 '22 21:10 rusq

It will be fixed in v0.12.

kanata2 avatar Dec 11 '22 21:12 kanata2