Commit Graph

27 Commits

Author SHA1 Message Date
Harrison Healey
dbf54b3599 MM-13838 Bypass the HTTP client when getting image dimensions from the image proxy (#10208)
* MM-13838 Bypass the HTTP client when getting image dimensions from the proxy

* Add additional log messages to debug failing test

* Fix unit test to work on Jenkins
2019-02-04 12:43:30 -05:00
Harrison Healey
46b05499cc MM-13932 Fix image metadata for invalid image links (#10217) 2019-02-01 18:23:04 -04:00
Daniel Schalla
a2f46c0466 [MM-13889] Limit OpenGraph data response size (#10213)
* Limit OpenGraph data response size

* Add LimitReader to Metadata Image
2019-02-01 18:55:43 +01:00
Harrison Healey
ee9395f1b6 MM-13917 Enable post metadata by default (#10210) 2019-01-31 14:57:50 -05:00
Harrison Healey
7c677b6196 MM-13207 Add customizable timeout for link metadata and improve caching of errors (#10188)
* MM-13207 Add customizable timeout for link metadata and improve caching of errors

* Rename LinkMetadataTimeout to LinkMetadataTimeoutMilliseconds

* Add diagnostics for LinkMetadataTimeoutMilliseconds
2019-01-31 09:40:23 -05:00
Hanzei
0c981aa010 Prohibit variable shadowing (#10177)
* Prohibit variable shadowing

* Fix outstanding shadowed variables
2019-01-31 12:16:16 +01:00
Harrison Healey
26684716aa MM-13664 Cache external link metadata when populating post metadata (#10128)
* MM-13664 Added LinkMetadata types

* MM-13664 Use LinkMetadata when populating post metadata

* Fix unused import

* Fix index name on SQLite

* Finish adding unit tests

* Address feedback

* Increase max length of URL column to 2048 characters
2019-01-28 16:25:08 +01:00
Harrison Healey
ba5566d1a0 MM-10417 Add local image proxy and enable by default (#9967)
* MM-10417 Add local image proxy and enable by default

* Remove unused function

* Add dependencies for willnorris/imageproxy

* Fixed compilation errors

* Lock to the master version of willnorris/imageproxy

* Fix atmos/camo proxy when no SiteURL is specified

* Re-add default values for deprecated settings

* Fix unit tests added by merge

* Pass imageproxy to App struct

* Remove unneeded locking when creating the image proxy

* Remove empty test file
2019-01-24 16:11:32 -04:00
Harrison Healey
1a3ccaf305 MM-13606 Remove consumeAndClose and clean up integration response handling (#10066)
* MM-13606 Remove consumeAndClose

* Allow overriding HTTPService's request timeout

* MM-13606 Clean up integration response handling

* Properly close httptest servers

* Address feedback

* Only call buf.Bytes when necessary

* Properly check for errors in doOutgoingWebhookRequest

* Add comment explaining ignored ioutil.ReadAll errors
2019-01-09 17:07:08 -05:00
Harrison Healey
aff3156c56 MM-13238 Fix link cache being cleared too often with image proxy (#9981) 2018-12-12 13:11:53 -05:00
Harrison Healey
1607d18e55 MM-12009 Resolve relative links in posts as the web app does (#9896) 2018-11-28 11:01:35 -05:00
Harrison Healey
4294758793 MM-13208 Rename DisablePostMetadata setting to EnablePostMetadata and turn off by default (#9894) 2018-11-27 16:13:02 -05:00
Harrison Healey
ba627c0f92 Skip getting the post again when getting file metadata for a post (#9879) 2018-11-26 10:47:01 +00:00
Harrison Healey
71dba81e91 MM-13015 Add safety valve setting to disable post metadata (#9877)
* MM-13015 Add safety valve setting to disable post metadata

* Remove setting from client config since it's no longer needed
2018-11-23 11:59:34 -05:00
Harrison Healey
d018554ef3 MM-11434 Only call PreparePostForClient once when creating a post (#9868) (#9876)
* MM-11434 Only call PreparePostForClient once when creating a post

* Have PreparePostForClient provide new metadata when a post already has it and update tests
2018-11-23 10:20:02 -05:00
Harrison Healey
eff68da254 MM-11434 Revert "Parallelize PreparePostListForClient" 2018-11-22 13:14:55 -05:00
Harrison Healey
5f65356a3f Address issues 2018-11-22 13:10:36 -05:00
Harrison Healey
5388afd37e Remove comments about deprecating FileIds and HasReactions (#9869) 2018-11-22 13:09:27 -05:00
Harrison Healey
23c8950312 MM-11434 Performance improvements for post metadata (#9849)
* Remove unused error return value from PreparePostForClient

* Remove unused error return value from PreparePostListForClient

* MM-11434 Parallelize PreparePostListForClient

* MM-11434 Skip looking reactions and files on post whenever possible

* Add note about the use of deprecated fields
2018-11-19 13:26:40 -05:00
Harrison Healey
2113ad0205 MM-13021 Fix warning logged when getting metadata for post without emojis (#9832) 2018-11-14 22:24:50 +05:30
Harrison Healey
fab63f8ba2 MM-12829 Check message attachments for emojis for post metadata (#9797) 2018-11-08 10:47:35 -05:00
Harrison Healey
ba173414d9 MM-12826 Include list of reactions in post metadata instead of just counts (#9749) 2018-11-01 15:41:43 -04:00
Harrison Healey
2190c37359 MM-12036 Add image dimensions for other fields in message attachments (#9748) 2018-11-01 15:41:37 -04:00
Harrison Healey
18684dd6de MM-11868/MM-12010/MM-12011/MM-12036 Improve post metadata structure (#9693)
* MM-11868/MM-12010/MM-12011/MM-12036 Include dimensions for opengraph and message attachment images in post metadata

* Remove duplicate check from getFirstLinkAndImages

* Add tests for getImagesInMessageAttachments

* Rename PostMetadata.FileInfos to PostMetadata.Files

* Rename Metadata.ImageDimensions to Metadata.Images
2018-11-01 15:41:29 -04:00
Harrison Healey
3929cb0141 Replace App.HTTPClient calls after merge (#9387)
* Replace App.HTTPClient calls after merge

* Add missing import
2018-11-01 15:25:23 -04:00
Harrison Healey
2959b53d98 MM-11272 Add OpenGraph and image dimension metadata to posts (#9313)
* Move OpenGraph code into its own file

* Move OpenGraph image proxying to app layer

* Move test file code out of api4 package

* MM-11272 Add OpenGraph and image dimension metadata to posts
2018-11-01 15:25:11 -04:00
Harrison Healey
48f16b6401 MM-11272 Added initial post metadata (#9175)
* MM-11272 Added app.PreparePostForClient

* MM-11272 Added app.PreparePostListForClient

* MM-11272 Added EmojiStore.GetMultipleByName

* MM-11272 Added emojis to PreparePostForClient

* MM-11272 Added unit tests for getting reaction counts

* MM-11272 Added unit tests for TestPreparePostForClient

* MM-11272 Added emojis from reactions to Post.Emojis

* MM-11272 Always update post.UpdateAt when reactions change to bust cache

* Fixed merge conflicts

* Moved post metadata-related code into its own file

* Update store mocks

* Fixed typo

* Add missing license headers

* Updated post metadata tests when custom emojis are disabled

* Fix unreliable unit tests

* Fix inconsistent casing in SQL statements

* Fix blank line

* Invalidate store cache after making changes

* Clear post cache synchronously with reactions
2018-11-01 15:22:33 -04:00