Commit Graph

15 Commits

Author SHA1 Message Date
Agniva De Sarker
11513a8d0d MM-27507: Propagate rate limit errors to client (#15230)
* MM-27507: Propagate rate limit errors to client

We return an error from SendInviteEmails instead of just logging it
to let the client know that a rate limit error has happened.

The status code is chosen as 413 (entity too large) instead of 429 (too many requests)
because it's not the request which is rate limited, but the payload inside it which is.

Ideally, the email sending should have been implemented by a queue which would just return
an error to the client when full. That is also why we are not returning an X-Retry-After
and X-Reset-After in the headers because that would mix with the actual rate limiting.

A separate header X-Email-Invite-Reset-After might do the job, but it comes at an extra cost
of additional API surface and a clunky API. Instead, that information is contained in the error
response. The web client needs to just surface the error. An API client will have to do
a bit more work to parse the error if it needs to automatically know when to retry. Given that
an email sending client is not a very common use case, we decide to keep the API clean.

This decision can be revisited if it becomes problematic in the future.

https://mattermost.atlassian.net/browse/MM-27507

* Fixing translations

* Added retry_after and reset_after in API response.
2020-08-13 22:19:05 +05:30
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
Jesse Hallam
5acb0ad227 MM-16369: include potential subpath in emails (#11311)
* MM-16369: include potential subpath in emails

Various email templates were extracting the `Host` but not the `Path` from the SiteURL, excluding a potential subpath defined therein.

* improve coverage of condenseSiteURL
2019-06-26 09:13:09 -03:00
Chris
b066b6df13 Remove global app references (#7433)
* remove global app references

* test fix

* fix api4 test compilation
2017-09-12 09:19:52 -05:00
Christopher Speller
7bc8e9a08d Adding jenkinsfile for new build server. 2017-09-06 23:11:58 -07:00
Chris
1adfd0e9be app type transition (#7167) 2017-09-06 17:12:54 -05:00
Carlos Tadeu Panato Junior
12a9180807 [PLT-1015] Make all Mattermost system emails Multi-Part, with both a HTML and Plain Text version. (#5698)
* Implementation to Make all Mattermost system emails Multi-Part, with both a HTML and Plain Text version

* update lib

* update code per review

* update to use the mattermost repo
2017-08-21 11:31:13 -07:00
Christopher Speller
00f48a1908 Adding short unit tests by default (#6494) 2017-05-25 11:01:53 -04:00
William Gathoye
01fab5de94 Fix some issues in English (#5714) 2017-05-11 09:45:25 -04:00
Christopher Speller
9a87bb3af6 Creating common token store and moving email invites and verification to it (#6213) 2017-04-27 10:55:03 -04:00
Harrison Healey
fb6f2a123c PLT-5860 Updated copyright date (#6058)
* PLT-5860 Updated copyright date in about modal

* PLT-5860 Updated copyright notice in JSX files

* PLT-5860 Updated copyright notice in go files

* Fixed misc copyright dates

* Fixed component snapshots
2017-04-12 08:27:57 -04:00
Corey Hulen
6bf080393d Fixing race conditions in the code base (#5966)
* Adding initial race detector

* Remove setting of config twice

* Fixing config file watch and config reload on license save

* Fixing config file watch and config reload on license save

* Fixing build error

* Fixing locking issue

* Fixing makefile

* Fixing race in config

* Fixing race in status unit test

* Adding EE race tests

* Fixing race in cluster info

* Removing code that's isn't needed

* Fixing some more races

* Fixing govet issue
2017-04-04 14:42:07 -04:00
Carlos Tadeu Panato Junior
11f1859de1 improvements for inbucket email test and re-enable Email mention test (#5647)
Now if we dont get the mailbox to check the email we try 5 times, if
still no message we disable the email verification.
2017-03-11 19:39:00 -03:00
Carlos Tadeu Panato Junior
e5065cf757 Make all emails with the same pattern on subject (#5198)
* make all email subject standard

* move SendPasswordReset to app/email.go

update per review

* update email subjects per review

update error

fix expected subject

* Update email_test.go

* Update en.json

* fix missing quotes
2017-03-01 09:28:38 -05:00
Carlos Tadeu Panato Junior
9728b71f08 Add tests for app/email.go (#5187)
* Add tests for app/email.go

* fix issue related with inbucket

* applied go fmt
2017-01-26 11:48:23 -05:00