summaryrefslogtreecommitdiffstats
path: root/app/webhook_test.go
Commit message (Collapse)AuthorAgeFilesLines
* added the custom icon and username for the outgoing webhook and its response ↵Pradeep Murugesan2018-07-251-0/+181
| | | | | | | | | | | | (#9141) * 8272 added the username and icon as part of the model and persisted the same * 8272 added the custome icon and name when set to the web hook response * 8272 changed the infinte loop to timeout after 5 seconds * 8272 fixed review comments
* Relax 4k post message limit (#8478)Jesse Hallam2018-03-261-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9661: rename POST_MESSAGE_MAX_RUNES to \0_v1 * MM-9661: s/4000/POST_MESSAGE_MAX_RUNES_V1/ in tests * MM-9661: introduce POST_MESSAGE_MAX_RUNES_V2 * MM-9661: migrate Postgres Posts.Message column to TEXT from VARCHAR(4000) This is safe to do in a production instance since the underyling type is not changing. We explicitly don't do this automatically for MySQL, but also don't need to since the ORM would have already created a TEXT column for MySQL in that case. * MM-9661: emit MaxPostSize in client config This value remains unconfigurable at this time, but exposes the current limit to the client. The limit remains at 4k in this commit. * MM-9661: introduce and use SqlPostStore.GetMaxPostSize Enforce a byte limitation in the database, and use 1/4 of that value as the rune count limitation (assuming a worst case UTF-8 representation). * move maxPostSizeCached, lastPostsCache and lastPostTimeCache out of the global context and onto the SqlPostStore * address feedback from code review: * ensure sqlstore unit tests are actually being run * move global caches into SqlPostStore * leverage sync.Once to address a race condition * modify upgrade semantics to match new db semantics gorp's behaviour on creating columns with a maximum length on Postgres differs from MySQL: * Postgres * gorp uses TEXT for string columns without a maximum length * gorp uses VARCHAR(N) for string columns with a maximum length of N * MySQL * gorp uses TEXT for string columns with a maximum length >= 256 * gorp uses VARCHAR(N) for string columns with a maximum length of N * gorp defaults to a maximum length of 255, implying VARCHAR(255) So the Message column has been TEXT on MySQL but VARCHAR(4000) on Postgres. With the new, longer limits of 65535, and without changes to gorp, the expected behaviour is TEXT on MySQL and VARCHAR(65535) on Postgres. This commit makes the upgrade semantics match the new database semantics. Ideally, we'd revisit the gorp behaviour at a later time. * allow TestMaxPostSize test cases to actually run in parallel * default maxPostSizeCached to POST_MESSAGE_MAX_RUNES_V1 in case the once initializer panics * fix casting error * MM-9661: skip the schema migration for Postgres It turns out resizing VARCHAR requires a rewrite in some versions of Postgres, but migrating VARCHAR to TEXT does not. Given the increasing complexity, let's defer the migration to the enduser instead.
* [MM-9725] Slack compatibility code in webhooks captures incorrect text (#8428)Carlos Tadeu Panato Junior2018-03-121-0/+58
|
* Finally remove utils.Cfg (#8113)Chris2018-01-171-16/+0
| | | | | | | | * finally remove utils.Cfg * fix compile error * another test compilation fix
* [PLT-8173] Strip the post_ prefix on incoming webhook overrides. (#8019)Jesse Hallam2018-01-031-42/+42
|
* [PLT-8173] Add username and profile picture to webhook set up pages (#8002)Jesse Hallam2018-01-021-0/+283
|
* [PLT-8438] Include incoming webhook display name in post props (#7997)Carlos Tadeu Panato Junior2017-12-221-1/+3
|
* Role refactor (#7867)Chris2017-11-211-6/+1
| | | | | | | | * role refactor * add missing file * fix web test
* [PLT-840] Add option to outgoing webhooks to reply to the posted message as ↵Carlos Tadeu Panato Junior2017-11-201-2/+2
| | | | a comment (#7807)
* more global config ref cleanup (#7802)Chris2017-11-091-3/+3
|
* PLT-7599: webhook post splitting (#7707)Chris2017-10-241-0/+96
| | | | | | | | * webhook post splitting * style fix * update old webhook test
* Reduce utils.Cfg references (#7650)Chris2017-10-181-1/+1
| | | | | | | | | | | | * app.UpdateConfig method * test fix * another test fix * the config override option as-was is just error prone, remove it for now * derp
* PLT-7818 Updates to post type (#7579)Joram Wilander2017-10-091-0/+5
| | | | | | * Updates to post type * Update tests
* Don't use global app for api / api4 tests (#7528)Chris2017-10-021-1/+1
| | | | | | | | | | | | | | * don't use global app for api / api4 tests * put sleep back. we're gonna have to do some goroutine wrangling * fix oauth test config assumptions * jobs package, i'm comin' for you next * app test fix * try increasing sleep a little
* Remove global app references (#7433)Chris2017-09-121-6/+5
| | | | | | | | * remove global app references * test fix * fix api4 test compilation
* Renaming repoChristopher Speller2017-09-061-2/+2
|
* app type transition (#7167)Chris2017-09-061-5/+6
|
* PLT-5745 Cleaning up duplicate calls (#7298)Corey Hulen2017-08-281-1/+1
| | | | | | | | * PLT-5745 Cleaning up duplicate calls * Fixing missing calls * Fixing broken test
* PLT-7212: fix missing webhook post attachments (#7011)Chris2017-08-031-0/+47
* fix missing webhook post attachments * make ProcessSlackAttachments return a new slice instead of modifying it