Jesse Hallam
74533371b2
MM-18115: fix segment v3 usage ( #12317 )
...
* diagnostics_test.go: fix spacing
* diagnostics_test.go: explicitly assert payload
This fails, since the package is currently receiving struct pointers and won't set the MessageId or Timestamp on the corresponding Message.
* MM-18115: fix segment v3 usage
In v5.14, we updated [github.com/segmentio/analytics-go](https://github.com/segmentio/analytics-go ) to v3 as part of https://mattermost.atlassian.net/browse/MM-12389 . As noted in the [migration guide](https://segment.com/docs/sources/server/go/#migrating-from-v2 ), the API subtly changed to expect a struct value and not a struct pointer:
```go
// in v2, you would call the `Track` method with a `Track` struct.
client.Track(&track)
// in v3, you would call the `Enqueue` method with a `Track` struct.
// Note that a pointer is not used here.
client.Enqueue(track)
```
Unfortunately, we kept passing a pointer, and the package didn't complain since it only required an interface -- which the pointer to these structs still implemented. Internally, it only checked for the value types, and failed to annotate our payloads with the requisite metadata. Upstream, segment.io accepted the payload, but then discarded it silently.
This has since been reported and fixed in https://github.com/segmentio/analytics-go/pull/146 , but isn't yet part of a tagged release of the package.
Fix our code to pass struct values instead.
Fixes: MM-18115
2019-09-26 23:49:43 -03:00
..
2019-09-06 12:52:14 +02:00
2019-09-12 17:58:16 +02:00
2019-07-22 22:13:39 +02:00
2019-05-24 20:22:13 +02:00
2019-04-15 22:53:52 +02:00
2018-01-31 09:49:15 -08:00
2019-07-06 09:05:44 +02:00
2019-09-09 13:43:17 +02:00
2019-09-18 20:02:22 +02:00
2018-05-16 13:43:22 -04:00
2018-03-07 12:36:40 -06:00
2018-05-16 13:43:22 -04:00
2019-09-17 14:37:10 +01:00
2019-08-19 14:15:09 -04:00
2019-08-19 14:15:09 -04:00
2018-05-16 13:43:22 -04:00
2019-07-29 11:30:16 +02:00
2019-07-11 12:00:12 -04:00
2019-07-11 12:00:12 -04:00
2019-08-08 17:23:37 -04:00
2019-09-24 15:22:09 +02:00
2019-09-04 13:41:29 +02:00
2019-02-14 13:52:11 -04:00
2019-09-17 12:20:23 +02:00
2019-07-18 15:05:53 -03:00
2019-01-15 09:09:25 -08:00
2019-04-23 09:33:42 -04:00
2019-04-12 18:00:57 +01:00
2019-04-23 09:33:42 -04:00
2019-04-12 18:00:57 +01:00
2019-04-23 09:33:42 -04:00
2019-06-18 10:44:29 +01:00
2019-06-18 10:44:29 +01:00
2017-09-14 13:01:44 -04:00
2019-04-23 09:33:42 -04:00
2019-04-23 09:33:42 -04:00
2019-09-10 14:08:29 +02:00
2019-05-29 09:54:56 -04:00
2019-09-24 15:10:58 +02:00
2019-09-13 10:57:47 +02:00
2019-04-23 09:33:42 -04:00
2019-02-14 13:52:11 -04:00
2019-04-23 09:33:42 -04:00
2019-02-14 13:52:11 -04:00
2019-07-10 10:46:03 +02:00
2019-04-23 09:33:42 -04:00
2019-06-20 15:21:36 +02:00
2019-07-22 22:13:39 +02:00
2019-07-22 22:13:39 +02:00
2019-09-17 14:37:10 +01:00
2019-04-23 09:33:42 -04:00
2019-06-20 17:16:36 -04:00
2019-06-20 17:16:36 -04:00
2019-09-03 22:11:55 +02:00
2019-09-03 22:11:55 +02:00
2019-09-19 18:01:30 +01:00
2019-06-20 15:21:36 +02:00
2019-04-23 09:33:42 -04:00
2019-04-23 09:33:42 -04:00
2019-04-23 09:33:42 -04:00
2019-02-14 13:52:11 -04:00
2019-07-10 10:46:03 +02:00
2019-04-23 09:33:42 -04:00
2019-04-23 09:33:42 -04:00
2019-04-23 09:33:42 -04:00
2019-04-23 09:33:42 -04:00
2019-03-04 15:27:59 +01:00
2019-09-24 18:30:23 +02:00
2019-04-24 11:50:25 +01:00
2019-09-24 16:49:23 +02:00
2019-07-08 07:46:31 +01:00
2017-10-02 12:43:21 +01:00
2019-09-26 23:49:43 -03:00
2019-09-26 23:49:43 -03:00
2018-09-24 12:52:29 +05:30
2019-09-24 15:33:58 +02:00
2019-09-16 17:28:13 -04:00
2019-06-26 09:13:09 -03:00
2019-08-06 12:07:35 +02:00
2019-09-11 22:49:27 -05:00
2019-04-10 06:04:07 -04:00
2019-04-30 20:36:21 +02:00
2019-09-13 11:51:46 +02:00
2019-08-01 09:19:37 -03:00
2019-05-15 22:07:03 +02:00
2019-09-14 12:53:37 +02:00
2019-09-17 13:48:22 -04:00
2019-06-28 07:31:32 -04:00
2019-07-30 12:04:08 -04:00
2019-09-16 18:11:17 -04:00
2019-08-04 13:05:33 +03:00
2019-09-20 12:45:28 -06:00
2019-07-08 16:17:06 +01:00
2019-08-14 14:58:01 +03:00
2019-09-24 15:37:47 +02:00
2019-04-30 20:36:21 +02:00
2019-07-08 16:17:06 +01:00
2019-09-11 11:35:51 -04:00
2019-07-08 08:50:55 -03:00
2019-06-15 17:55:06 +02:00
2019-06-15 17:55:06 +02:00
2019-05-10 11:47:21 -04:00
2019-09-18 10:38:28 -06:00
2019-09-13 09:07:00 -04:00
2019-09-24 15:25:24 +02:00
2019-07-22 22:13:39 +02:00
2019-04-23 09:33:42 -04:00
2019-07-06 09:07:54 +02:00
2019-09-20 09:04:10 -06:00
2019-09-03 10:33:49 -04:00
2019-09-09 13:32:30 +02:00
2019-09-24 17:10:47 +02:00
2019-09-03 10:33:49 -04:00
2019-09-11 07:52:12 -07:00
2019-09-24 15:32:13 +02:00
2019-06-26 16:06:41 +05:30
2019-09-09 20:10:17 +02:00
2019-07-18 15:46:54 -04:00
2019-05-13 07:53:46 -07:00
2019-04-12 18:00:57 +01:00
2019-07-22 22:13:39 +02:00
2019-05-21 18:22:27 +02:00
2019-07-11 14:54:56 +01:00
2019-09-19 18:33:24 -04:00
2019-09-17 14:37:10 +01:00
2019-09-10 12:28:12 -04:00
2019-09-10 12:28:12 -04:00
2018-12-05 10:46:08 -08:00
2019-09-14 23:08:04 +02:00
2019-07-18 15:05:53 -03:00
2019-09-10 12:28:12 -04:00
2019-08-22 15:17:47 -04:00
2019-08-21 23:25:38 -03:00
2019-07-17 09:08:58 -04:00
2019-09-05 17:27:36 -03:00
2018-11-20 08:52:51 -05:00
2019-08-02 18:46:32 -03:00
2019-09-17 15:02:26 -04:00
2019-09-26 13:54:51 -04:00
2019-08-22 23:00:37 +02:00
2019-09-24 15:23:30 +02:00
2019-09-17 14:37:10 +01:00
2019-06-11 10:51:55 +02:00
2019-06-24 12:03:29 +02:00
2019-09-12 13:35:07 +02:00
2019-06-17 15:39:14 +03:00
2019-05-17 12:03:04 -03:00
2019-03-06 15:06:45 -05:00
2019-07-08 21:30:32 +02:00
2019-09-11 07:33:07 -04:00
2019-08-21 20:23:06 +02:00
2018-12-17 08:51:46 -08:00
2019-04-23 09:33:42 -04:00
2019-09-26 23:49:43 -03:00
2019-07-22 22:13:39 +02:00
2019-07-22 22:13:39 +02:00
2019-02-14 13:52:11 -04:00
2019-07-04 11:57:12 +02:00
2019-07-11 10:47:51 +01:00
2019-09-16 13:37:14 +02:00
2019-02-14 13:52:11 -04:00
2019-07-03 08:35:39 -04:00
2019-02-27 14:06:56 -05:00
2019-02-27 14:06:56 -05:00
2019-06-28 07:31:32 -04:00
2019-08-08 03:39:23 +05:30
2019-09-17 14:38:22 +01:00
2019-09-10 11:50:27 -05:00
2019-07-02 16:22:20 +02:00
2019-09-20 16:53:48 +02:00
2018-10-15 20:01:35 +01:00
2019-02-14 13:52:11 -04:00
2019-07-02 16:22:20 +02:00
2019-09-10 11:45:08 +02:00
2019-09-17 20:13:17 +01:00
2019-09-17 20:13:17 +01:00
2019-02-14 13:52:11 -04:00
2019-09-11 11:16:33 -04:00
2019-09-24 16:44:01 +02:00
2019-09-24 15:35:20 +02:00
2019-09-06 12:52:51 +02:00
2019-09-13 01:31:59 -04:00
2019-09-12 20:30:41 -04:00