Firebase console is not showing updated data - javascript

I am writing data to Firebase using the following code:
firebase.database().ref('cards/1').set({
val:1
});
I then retrieve the data using the following code:
firebase.database().ref('cards/1').once('value').then(function(snapshot) {
console.info('Getting value from database:')
console.info(snapshot)
})
The code above works fine and is displaying correct result. However firebase console is not reflecting the update. I even tried logging out and back in. What am I doing wrong?

Didn't work for me either.
But to get latest logs, run this command in your terminal: firebase functions:log
You can see the updated logs.

I had the same problem, my documents were not showing in Firebase Console.
According to the Usage and billing page:
The resources available to you in the plans are capped. If your
project exceeds a limit, services may be disabled for that product.
After I upgraded, it started working again.
This could be because you have reached your daily quota.
If you click on the 'billing and quota usage' link on your Usage Over Time you can check if you have reached your quota.

I had the same problem, although I was using Firebase on Android. My issue was that for some reason, the SDK was providing me with an instance set in another location from the one I specified during the setup. To solve this, I had to provide the URL of the database, got the right reference from there, and the data was being updated.

Related

Why does a Cloud Function for Firebase (deployed without errors), throw "Uncaught (in promise) FirebaseError: internal" when called? [duplicate]

After months of developing a Web App under Firebase suddenly these days we have a problem with the Authentication, it returns this console.alert only with Facebook and google login (email/pass login works fine):
[firebase-auth] Info: The current domain is not authorized for OAuth
operations. This will prevent signInWithPopup, signInWithRedirect,
linkWithPopup and linkWithRedirect from working. Add your domain
(front.qualify.mx) to the OAuth redirect domains list in the Firebase
console -> Auth section -> Sign in method tab.
The App uses 3 different sub-domains, and in all 3 we can access over email/pass but not Facebook nor google.
We tried updating the Firebase initialization script, nothing. We have checked the API keys (in the Google APIs Credentials) and there was a new "Server key (auto created by Google Service)" which no one told us it was generated (Jan. 18th), so we edited it to include the domains as the original API key in different ways (w/wo * and /*), nothing. We deleted this new Server Key, suddenly something different, now the console includes a 403 error before the alert stated above and returns auth/timeout code inside the object.
We also found the Identity Toolkit API has detected many errors, so we tried to add the URLs for login, logout and email, but nothing happens when trying to save.
What are we missing?
The solution was adding my-app.firebaseapp.com (being my-app the unique identifier of our Firebase App) to the HTTP referrers in the Browser-Key Credentials from the Google APIs console and wait some time to propagate.
After many months of development the app never had a problem, and we are sure we never removed such referrer (if it was ever there).
Anyway... it's done and learned.
The simple way I was able to solve this issue I had with my ionic project was by following the instructions in the log, if you don't see any message try console log the response from firebase.
So what I simply did was follow the url: https://console.developers.google.com/apis/api/identitytoolkit.googleapis.com/overview?project='projectId'
*projectId = the Id of your project
and enable the Identity API something it brought up. Finish, and it worked instantly.

Is there anyway i can update a firestore document automatically even if app is closed, is there a listeener or something

i have a firestore and project that needs to be updated automatically without user interaction but i do not know how to go about it, any help would be appreciated. take a look at the json to understand better
const party = {
id: 'bgvrfhbhgnhs',
isPrivate: 'true',
isStarted: false,
created_At: '2021-12-26T05:20:29.000Z',
start_date: '2021-12-26T02:00:56.000Z'
}
I want to update the isStarted field to true once the current time is equal to start_date
I think you will need Firebase Cloud Function, although I don't understand exactly what you mean.
With Cloud Functions, you can automatically run (add, delete, update, everything) codes on Google's Servers without the need for application and user interaction.
For example, in accordance with your example, it can automatically set "isStarted" to true when it hits the "start_date" time. If you want to code a system that does not require user interaction and should work automatically, you should definitely use Cloud Functions. Otherwise, you cannot do this on the application side.
For more info visit Cloud Functions
Ok, I managed to find a workaround to updating my documents automatically without user interaction since the google billing service won’t accept my card to enable cloud functions for my project, I tried what I could to make my code work and I don’t know if other peeps would follow my idea or if my idea would solve similar issues.
What I did was that in my nextjs file I created an API endpoint to fetch and update documents after installing the firebase admin SDK, so I fetched all documents and converted all start_date fields in each document to time and checked for documents whose start date is less than or equal to current date, so after getting the document, I ran a firestore function to Update the document.
Tho this will only run when you make a request to my domain.com/api/update-parties and never run again
In other to make it run at scheduled intervals, I signed up for a free tier account at https://www.easycron.com and added my API endpoint to EASYCRON to make requests to my endpoint at a minute interval, so when the request hits my endpoint, it runs my code like other serverless functions😜. Easy peezy.

Unable to fetch user data by using tiktok-scraper npm package

I have used tiktok-scraper for getting any public TikTok users data. It was working fine recently and I was able to get the required data but suddenly it stopped working and started giving this error:
Error: Can't extract user metadata from the HTML page. Make sure that the user does exist and try to use proxy
The module that I have used is .getUserProfileInfo('USERNAME', options) without using any options. Earlier I was able to get user details by just passing the username.
Someone has suggested to try using the cookie "sessionid_ss" in the sessionList option but I don't know where can I get this value from.
It would be great if someone can guide in this regard to get any public TikTok users' details based on the username.

How to parse error with Square Connect API example (Node)

I am trying to learn how to process payments with Square, and am trying to run their examples from GitHub to get a feel regarding how to structure the payments application. I built the node example from here: https://github.com/square/connect-api-examples/tree/master/connect-examples/v2/node_payment using npm install and npm build to get the app up and running.
I am using "4532759734545858" for the card number, "123" for CVV, "0120" for expiration, and "94103" for the zip. I got the card number from here: https://docs.connect.squareup.com/articles/using-sandbox where it states that this is a good number to use for a Visa sandbox.
Also, I have updated the config.json with properties from my developer settings.
When trying to process a payment a get a DOM element that says "Card Declined" without further specifying the error. Is there something I can do to parse the error?
Based on the documentation at: https://docs.connect.squareup.com/articles/using-sandbox#generatingerrorstates it seems the amount_money field of the request is not being populated, but I am having trouble confirming.
Ideally I would like to get to a point where I can add a card as a hash value to my db and use it for recurring billing...
That "card declined" message is actually the error you get back from Square's APIs. You can play around with the error messaging in the app.js file and the `error.jade. Try error.catagory, code, detail.
Keep in mind that this is just a sample app, to show that you can use the APIs with node.js, you probably don't want to use this code in your production system.

Access server files with ArcGIS javascript api

I have a geoprocessing service that takes two parameters: netCDF (file) and Date (str). I'm working off of the demo found here.
The issue I have is getting the netCDF file to the geoprocessing service. By creating an upload feature I can see how I would be able to provide the needed parameter but I already have all the necessary files server side.
How can I get my web application to read local netCDF data into the geoprocessing service?
Any suggestions would be greatly appreciated.
My testing application can be found here.
Service: http://sroarcgis.ducks.org/ducksunlimited/rest/services/wsi_tool/GPServer
I receiver the error message: Error {code: 400, message: "Invalid or missing input parameters.", details: Array[0], log: undefined, httpCode: 400}
Thanks!
I'm not sure if this applies to your geoprocess, but I got this same error message and I finally fixed my problem:
Make sure you have the same fields in the search results as you have in the table the search is linked to.
It was a simple fix that took me awhile to find (as these things usually go). I had included a field that was visible in other tables, but that I had had turned off in this table before publishing the map.
Hope this helps!
After speaking with ESRI support they said that I would need to enable uploads on my web server, then upload each file individually.
Regarding your "Invalid or missing input parameters." error, you may be able to resolve this error using the following steps:
Log into ArcCatalog
Create a database connection as the user who is the owner of the table.
Select the table in the Catalog Tree.
Click the Preview tab. (Not sure if this step is really needed, but it will confirm that the metadata was refreshed properly.)
This error can crop up if the table columns change in some way. I think this process refreshes the SDE Metadata associated with the table.

Categories

Resources