diff options
author | Vincent Ambo <mail@tazj.in> | 2020-07-06T21·30+0100 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2020-07-06T21·35+0000 |
commit | 8b5859319347a0da80e9d7fd4dd1a7b5dec84e52 (patch) | |
tree | 88c611e22d0b4fb61feb73b54b0786dcd51b4471 /third_party/lieer/discovery_doc.patch | |
parent | a0f9ae996d33a82b3cf057f92d5560f7f730a44d (diff) |
fix(3p/lieer): Work around issues in Google Mail API r/1226
There is a temporary issue affecting the retrieval of discovery documents in the Google Mail API: https://issuetracker.google.com/issues/160441983 It's possible to work around this by hardcoding the document instead of retrieving it over the network, as all other API calls still work as they should. This does exactly that by generating a patch to apply to lieer, from the file checked in to the depot with this commit. This workaround should be reverted once Google has fixed the issue upstream. Change-Id: I0063d0bc67753ffa5261c2aa059c7bfd09136ba0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/945 Tested-by: BuildkiteCI Reviewed-by: isomer <isomer@tvl.fyi>
Diffstat (limited to 'third_party/lieer/discovery_doc.patch')
-rw-r--r-- | third_party/lieer/discovery_doc.patch | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/third_party/lieer/discovery_doc.patch b/third_party/lieer/discovery_doc.patch new file mode 100644 index 000000000000..fd140ac6ef97 --- /dev/null +++ b/third_party/lieer/discovery_doc.patch @@ -0,0 +1,15 @@ +diff --git a/lieer/remote.py b/lieer/remote.py +index 6e3973a..2b0b59e 100644 +--- a/lieer/remote.py ++++ b/lieer/remote.py +@@ -386,7 +386,9 @@ class Remote: + if timeout == 0: timeout = None + + self.http = self.credentials.authorize (httplib2.Http(timeout = timeout)) +- self.service = discovery.build ('gmail', 'v1', http = self.http) ++ with open('${DISCOVERY_DOC}', 'r') as file: ++ discovery_doc = file.read() ++ self.service = discovery.build_from_document(discovery_doc, http = self.http) + self.authorized = True + + def __get_credentials__ (self): |