Gmail API Users.settings.sendAs: update, does not reflect on web client unless reloaded - gmail-api

I'm using the Gmail API Users.settings.sendAs: update to automatically update the signature settings of our users. The issue I'm having is the change in the signature does not get reflected in the Gmail web client unless the web page gets reloaded. Our users can spend several days, even couple of weeks, without reloading their Gmail web page, making the update almost useless.
I would like to know if there is a way for the web client to pick up the new settings once the changes are made through the API without requiring the user to reload the page?

You may want to use Push Notifications feature in Gmail API. This lets you watch for changes to Gmail mailboxes. You can use this feature to improve the performance of your application. Whenever a mailbox changes, the Gmail API notifies your backend server application.
Then, you may proceed with Synchronizing Clients with Gmail if you need to process changes. As discussed in the documentation, you can also use push notifications to trigger partial synchronization in real-time and only when necessary.
Hope that helps!

Related

Best practices for avoiding downtime when making changes to the API?

I am making a React-Django application which I have deployed using Vercel.
My concern is that sometimes I will need to make changes to the API and I am not sure how to handle that without causing downtime in production.
Say for example that I change an endpoint's payload (for example, I might change the variable names or its structure). Say I reflect those changes in the frontend, making sure that the frontend can accept the new payload.
Now, if I push the new API to live and the front-end has not been pushed to live yet, the (old) front-end will make get a payload it won't be able to work with and thus the app will crash. If on the other hand I push the new front-end to live but the new API is not live yet, the (new) front-end will get the old payload's structure which it's no longer able to work with. The app will crash in this case too.
How can I ensure that when I make changes to the API and to the frontend I can do so whilst also avoiding any downtime? What are the best practices to do this?
(As a reminder, the app has a React frontend and a Django backend and is deployed through Vercel)
Any help is appreciated, thank you!
In a project I worked on before I added a notification queue broadcasting a notification to logged in users saying that we're having maintenance and I block any request and displaying a toast and I block the login for some minutes synchronizing with my team to build and post the front updates.
I used react as front Symfony php as API and I used Mercury as Messaging queue
in your case you can use sockets.
Or if you're sure that your users won't use your app late at night synchronize with your team to make updates late at night but it's risky if someone use it so that's why I notify my users for some minutes

listen to Firestore's onSnapshot while app is not running

I want my app to be able to listen to onSnapshot while it is in background , I know that I can use background task for this by I don't know how to set it up .
btw I'm trying to implment this so that my app can push a notification whenever a new doc is received while app is in the background .
Most mobile operating systems severely limit what the app can do while it is backgrounded. Keeping an active connection open to a server is one of those things that has never been allowed on iOS, and has gotten more restrictive with recent Android versions.
The better approach is to run the code that detects a relevant change on a server, and then use Firebase Cloud Messaging (or APNS directly if you're only targeting iOS) to send a notification to the user. When they they tap on that notification, your app is started and you can load the data from Firestore.
If you don't want to run your own server, Cloud Functions is a common alternative for this, as it has built in triggers that respond to changes in Firestore. For an example of this exact scenario, see the documentation on notify users when something interesting happens.

Application that receives data in real time without refresh

I am developing a desktop program, a website and an application and they both communicate through the same database. I started researching about making these apps real-time, that I don't need to update to receive a new registration or a change to something. I discovered websockets and socket.io, saw some examples and read a lot about it, but then I saw that there are some databases that already do this and one of the most famous is firebase. What I would like to ask here is, using firebase can I make an application in real time? An application that when registering data to the database, all other connected applications receive this data in real time?
In google firebase, you can create listeners on the client-side to respond to any changes in the backend. Check out https://firebase.google.com/docs/firestore/query-data/listen.
This is great if you need to store data, but if you are purely looking to send information between clients and there is no need for any persistence, I would recommend using WebSockets.

Does bluemix have an API to fetch application monitoring/metrics results?

I see that bluemix has a service called Monitoring and Analytics. All I see from that service are dashboards. I am looking for the information the dashboards are providing in the form of an API. For example, if I want to be notified that my application is down or it is slow running, etc .. Is there a way for me to either receive such alerts or for an API that I can poll periodically?
thank you
The Monitoring & Analytics service does not offer an API to retrieve its collected metrics. We realize that supporting a programmatic interface would be helpful and it's in our backlog to add that capability.
However, M&A does support the other part of your question regarding alerts. There should be an Events tab in your dashboard. In the upper right corner, there's a dropdown to "Configure events policy". If you select it, you can enable Availability alerts ("Is my app down?") and/or Performance Monitoring alerts which are geared to the app's run-time type (Liberty, Node.js, etc.). In that same dropdown you can also "Configure notification". If you specify your email address in the notification dialog, you will start receiving alerts when your Bluemix application is down or running slowly.

Deleting and changing google appengine endpoints

I have created a small project in Google apengine and like it apart from one thing: It seems virtually impossible to delete or change an endpoint, once it has been made. The API often stays the same, regardless of code changes in the java endpoint classes. I tried to delete the complete API, but that is not possible either. Is there any way to do this?
RE: Deletion
it's not currently supported, but we're working on it.
RE: API Changes
The Google APIs Explorer web app aggressively caches, so you'll need to clear your cache or force a refresh when you update your API server side to see the changes in the client.

Resources