-
Notifications
You must be signed in to change notification settings - Fork 70
[IMP] gmail: remove the enrichment feature from the addon #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
std-odoo
wants to merge
7
commits into
odoo:master
Choose a base branch
from
std-odoo:master-mail-plugin-rework-no-iap-std
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[IMP] gmail: remove the enrichment feature from the addon #52
std-odoo
wants to merge
7
commits into
odoo:master
from
std-odoo:master-mail-plugin-rework-no-iap-std
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e679c10 to
2da20fd
Compare
173c0ec to
d710a18
Compare
e259ed2 to
89e1fb5
Compare
6a4bfa2 to
4610569
Compare
df57832 to
8784f69
Compare
36c5354 to
9d9c14a
Compare
9d9c14a to
6e15be2
Compare
7407ba1 to
1a8cfd2
Compare
0c8e3ce to
243823e
Compare
Purpose ======= Because we cannot close the popup in which the user login like before, we now show the rainbow man when we have received the access token during the login flow. Task-4727609
Purpose ======= Before the subject, email from, etc were added in the body of the email when we log it in a record. Now, those values are properly written in the fields of the `mail.message`, and so we need to send them to the Odoo endpoint. Parse all the contacts in the email TO, CC,... to prepare the following commit. Before, if we wait some time before logging the email on a record, an error could be raised because the token we received to get the information expired. To solve that issue, we parse and save then in the state when the addin is loaded. Task-4727609
Purpose ======= Then enrichment feature of the addon made it slow and hard to use in practice, so we simplify it, and we keep only the core feature, which is logging the email on the records and viewing information about the contact. If a conversation contains many contacts, before it took the first one. We can now choose the contact we want to open. Allow searching any records, not only partners. We fixed some UI issues than were introduced by update of the Gmail API. Task-4727609
Purpose ======= The current addin is slow, because of how appscript work (Google host a web server, with our app running, that server restart at each call, the language itself is synchronous...). In alternative way of creating addin, is to host the application ourselves. It's faster because we can keep the server alive, and we can make the HTTP calls in parallel (to the Gmail API and to the Odoo database). > https://developers.google.com/workspace/add-ons/guides/alternate-runtimes We choose to use node with express, because it's asynchronous, and we will make a lot of request (to the Odoo database, to the Gmail API, etc). Also, most of the code can be re-used (the core logic). The main changes compared to appscript are - we need to store the user settings ourselves (and we use psql for that) - so the translations and the email logging state is moved to the user (it's considered as "User Settings / Information"). - to build the view, our endpoints need to return JSON, so we created some helper classes similar to the one use by appscript (no official library exists for that at the moment, for typescript) The application has been kept as similar as the one using appscript as possible (the execution of action, with the state of the current page is sent in the response). Task-4727609
Purpose ======= Now that all users will share the same process on the server, we want to prevent the state from being modified by using JWT token. Task-4727609
e966ed6 to
0c6c040
Compare
Purpose ======= When we used appscript, we didn't have a web server to store the image (and to do the processing to translate text inside the SVG), and so we base 64 encoded them. Now that we moved the HTTP addin, we have a web server, and we can serve the files (and translate them on the fly), so that the images are cached by the browser, and we don't download them each time we view a new card. When Gmail shows images, it doesn't add our URL in the dom, instead it fetches the image, and store it in `googleusercontent.com`. But, it won't fetch the images if they come from a ngrok domain name, so now, we need a "real" domain name for development. Task-4727609
0c6c040 to
dd03979
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Then enrichment feature of the addon made it slow and hard to use in
practice, so we simplify it, and we keep only the core feature, which
is logging the email on the records and viewing information about the
contact.
If a conversation contains many contacts, before it took the first
one. We can now choose the contact we want to open.
Allow searching any records, not only partners.
We fixed some UI issues than were introduced by
update of the Gmail API.
Task-4727609