summaryrefslogtreecommitdiffstats
path: root/model
Commit message (Collapse)AuthorAgeFilesLines
* Relax 4k post message limit (#8478)Jesse Hallam2018-03-262-18/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Adding go client support and basic unit tests for channel autocomplete. (#8510)Christopher Speller2018-03-261-0/+11
|
* [MM-9777] Avoids adding custom emojis with the same name as a system emoji ↵Fede2018-03-233-1/+17
| | | | | | | | | | | | | | | | | | (#8461) * Emoji validation fails if name exists in system emojis * Use hashmap instead of array to improve performance * Changed utils/StringInMap to emoji/isSystemEmoji * Load system emojis from model/emoji.json * Added emoji.json from webapp * Load system emojis from emoji_data.go instead of emoji.json * Run `gofmt -w model/emoji_data.go`
* Timezone feature (#8185)Chris Duarte2018-03-224-0/+666
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add supported timezones into config Remove Timezone list creation in favor of timezone from configs Add Timezone field to Users table Clean up format of SupportedTimezones in config * Remove unwanted change * Add test for updating user timezone * Add empty map[string]string if Timezone is null * Add EnableTimezoneSelection config * Revert back to map[string]string for ClientConfig * Refactor SupportedTimezones into timezones.json * Include timezones.json in TestConfigFlag * Add timezone api endpoint * Bump varchar size to 256 and setMaxSize in user_store * Refactor LoadConfig to LoadConfig and LoadTimezoneConfig * Remove unnecessary argument in LoadConfig, mail_test * Add test for timezone endpoint * Add license header * Refactor timezones endpoint to system.go * Add system base route to timezone endpoint * db timezone upgrade in db v4.9 * Avoid saving SupportedTimezones to config.json * Add timezonePath support in config * Remove EnableTimezoneSelection from config * Use return statement without return parameter * Refactor test for SupportedTimezones * Check for supportedTimezone != nil instead of using len * Decouple SupportedTimezones out of Config * Fix failing test * Add LastTeamIconUpdate back in upgrade.go * Write timezone config in config_flag_test * Add code fallback for default timezone support
* add config for saml home realm discovery bypass (#8480)Chris2018-03-201-0/+3
|
* update email test in the driver to be able to send the config in the body ↵Carlos Tadeu Panato Junior2018-03-131-2/+2
| | | | | (#8453) Signed-off-by: cpanato <ctadeu@gmail.com>
* MM-8839: Adds ChannelType to compliance-related model. (#8424)Martin Kraft2018-03-092-0/+4
|
* MM-9274- Sort Users in Channel by status (#8181)Stephen Kiers2018-03-091-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * sort by lastActivity * added status ordering to Users * sort offline before dnd * remove data not needed * added seperate call for when order=‘status’ is on GetUser request * remove PrintLn * styling fix * remove mistake * mistake 2 * better comment * explicit if statemnt * writing tests * removed manually added mocks * generated mock * ICU-668 Added unit tests * style fix * reverse dnd and offline * Fixed app.SaveStatusAndBroadcast * Fixed incorrect merge * Fixing incorrect merge again
* MM-8840: Add GlobalRelay Configuration Settings (#8304)Jonathan2018-03-082-14/+153
| | | | | | | | * Added new GlobalRelay config settings * Adding default values to global relay config * Migrate global relay config tests to table driven tests
* respect plugin manifest webapp bundle_path (#8393)Chris2018-03-071-0/+5
|
* general cleanup (#8387)Chris2018-03-0715-108/+9
|
* Add preparatory upgrade code for 4.9 (#8408)Joram Wilander2018-03-051-0/+1
|
* MM-8604: emit config/license websocket events (#8371)Jesse Hallam2018-03-051-0/+2
|
* PLT-7567: Integration of Team Icons (#8284)Christian Hoff2018-03-012-13/+67
| | | | | | | | | | * PLT-7567: Integration of Team Icons * PLT-7567: Read replica workaround, upgrade logic moved, more concrete i18n key * PLT-7567: Read replica workaround, corrections * PLT-7567: upgrade correction
* [PLT-8186] add support for ec2 instance profile authentication (#8243)Carlos Tadeu Panato Junior2018-02-281-0/+14
|
* fix scheduled task race (#8355)Chris2018-02-232-203/+57
|
* MM-8681 Adding config settings necessary for using CloudFront. (#8307)Christopher Speller2018-02-201-0/+20
| | | | | | * Adding config settings nessisary for using CloudFront. * Adding new config settings to diagnostics.
* MM-8710: Web Hub optimizations (#8293)Chris2018-02-202-0/+73
| | | | | | | | | | | | * webhub optimizations * test fix * minor fix * big perf improvement to ToJson after precomputing * fix hub connection count
* MM-9556 Added ability to upload files without a multipart request (#8306)Harrison Healey2018-02-201-1/+8
| | | | | | * MM-9556 Added ability to upload files without a multipart request * MM-9556 Handled some unusual test behaviour
* merge 4.7.1 to masterSaturnino Abril2018-02-191-0/+1
|\
| * Add upgrade code from 4.7.0 to 4.7.1JoramWilander2018-02-161-0/+1
| |
| * Remove bad field from ChannelMemberHistory modelJoramWilander2018-02-161-1/+0
| |
| * Renamed file to match existing schemeJonathan Fritz2018-02-131-0/+0
| |
| * Merge branch 'release-4.7' into XYZ-110Jonathan Fritz2018-02-139-180/+16
| |\
| * | Removed unused fields from ChannelMemberHistory table, introduced new ↵Jonathan Fritz2018-02-122-4/+15
| | | | | | | | | | | | model.ChannelMemberHistoryResult object that includes those fields that are selected from a join on other tables
* | | [PLT-539] Update incoming webhooks to accept multipart/form-data content (#7873)Carlos Tadeu Panato Junior2018-02-161-0/+9
| | |
* | | Merge release-4.7 with master in side branchDerrick Anderson2018-02-131-1/+1
|\ \ \ | | |/ | |/|
| * | Merge branch 'release-4.7' into rm-willnorris-proxy-supportChris2018-02-129-183/+15
| |\ \
| | * | revert master changesDerrick Anderson2018-02-129-183/+15
| | |/
| * / remove willnorris/imageproxy supportChristopher Brown2018-02-121-1/+1
| |/
* / XYZ-110: Cherrypicking changes from release-4.7 to master (#8254)Jonathan2018-02-132-4/+15
|/ | | | | | | | * Cherry-picking 7b2861de3a09cf00d00b0872cc537d54302c4bfa to master because enterprise/master has code in it that enterprise/release-4.7 does not, and I don't want enterprise/master to break the next time somebody merges enterprise/release-4.7 to enterprise/master * Renamed file to match existing scheme (cherry picked from commit 8c22c5c6c6f835a6e73faf19036bad2a51bb9127)
* Merge branch 'release-4.7'Derrick Anderson2018-02-092-2/+2
|\
| * Increase OAuth2 state parameter limitJoramWilander2018-02-072-2/+2
| |
* | fix client4 post sanitization (#8219)Chris2018-02-083-8/+67
| |
* | Eliminate utils.SetLicense calls (#8217)Chris2018-02-071-0/+19
| | | | | | | | | | | | | | | | | | | | * eliminate utils.SetLicense calls * test fix * another test fix * more test fixes
* | ABC-132: sign error page parameters (#8197)Chris2018-02-071-5/+18
| | | | | | | | | | | | * sign error page parameters * add comments
* | PLT-7537: Move channel CLI command posts system message to channel. (#8161)Vordimous2018-02-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | * [PTL-7537] implement feature and test * [PTL-7537] Update feature to post the the room requiring a username flag to be used * [PTL-7537] update tests with username * update test to remove changes to the test helper struct * use the basic team and user
* | XYZ-35: Added Support for GlobalRelay Compliance Export FormatJonathan2018-02-074-2/+77
|/ | | | | | | | | * Added username to ChannelMemberHistory struct in anticipation of supporting GlobalRelay in Compliance Export * Removed translation from debug output - this makes it complicated to use utils functions from tests in the enterprise repo * Added an advanced email function that allows for greater control over message details. Updated MessageExport config to support GlobalRelay. Added attachment support to InBucket unit tests * Moving templates in from enterprise to solve test issues * Added export format to diagnostics * Changed email attachment code to use FileBackend so that S3 storage is properly supported
* ICU-715 Change ExperimentalGroupUnreadChannels setting to allow for default ↵Harrison Healey2018-02-062-2/+48
| | | | on/off (#8211)
* Uncomment upgrade code for 4.7 (#8201)Joram Wilander2018-02-051-0/+1
|
* ABC-173: introduce Normalize(Username|Email) (#8183)Jesse Hallam2018-02-053-6/+38
| | | | This centralizes the source of truth on the rules for username / email processing instead of scattering `strings.ToLower` invocations.
* [PLT-8494] Add delete_team websocket event (#8167)Saturnino Abril2018-02-011-0/+1
| | | | | | * add delete_team websocket event * add to PermanentDeleteTeam
* User based rate limiting (#8152)Christopher Speller2018-01-311-1/+10
|
* unnamed return (#8170)Chris2018-01-3062-1235/+430
|
* PLT-3658 Added support for Slack attachments in outgoing webhook response ↵Joey Lee2018-01-261-6/+7
| | | | (#7774) (#8102)
* XYZ-32: Increases size of position to 128 characters. (#8148)Martin Kraft2018-01-262-3/+3
| | | | | | | | | | * XYZ-32: Changes type of 'position' column on 'users' table. * XYZ-32: Uncomment to run on CI and pre-release. * XYZ-32: Reverts translation changes. * XYZ-32: Fix for gofmt.
* Add GET /emojis/name/{emoji_name} API endpoint (#8142)Joram Wilander2018-01-241-1/+15
|
* [ICU-621] Add ExperimentalGroupUnreadChannels setting (#8127)enahum2018-01-231-0/+5
| | | | | | * Add ExperimentalGroupUnreadChannels setting * track ExperimentalGroupUnreadChannels in diagnostics
* Merge branch 'release-4.6'Harrison Healey2018-01-231-3/+5
|\
| * PLT-8522 Added separate messages for being removed from channel or team (#8078)Harrison Healey2018-01-101-3/+5
| |