I have a small problem that is driveing me crazy.
It seems that the Firestore Webpage is not showing my Database correctly.
If i add data via flutter it shows up immediately. And if i delete it again via code it dissapears like it should.
But if i delete in inside the Browser. It disapears but i can still access it via code.
The same thing applies to editing via the Browser. It changes visually but accessing via code i get the old Value. I thought i might be a delay so I waited until the next Day, but the web View and the code Values where still different.
Is this a Bug ?
.collection(FirebaseAuth.instance.currentUser!.uid)
.doc("SavedChain")
.snapshots()
.first;
This is how i access the data.
This is how i delete it
After deleting it, it disapears like it should. But i can still access it with the code above.
I suspect that snapshots().first gives you the cached value for the document. If that is the case, the solution is to use get() instead of those two calls:
.collection(FirebaseAuth.instance.currentUser!.uid)
.doc("SavedChain")
.get();
Related
Situation:
I have an 'Event' item that you can click on --> Event detail screen.
That has individual subitems (date,participants,description) in the form of a list.
I load the subitems with a Future Builder into a Listview.builder with a List Tile like so:
I have a button to edit the location, it saves to the database and locally updates the location variable. This calls SetState().
The full list is updated, even if some tiles don't have changes.
THE PROBLEM
Some tiles, like the participants tile needs to load pictures and some other things that are time intensive. So even if I just change the location and update the list, everything reloads, consuming resources and taking too much time to load a simple string.
WHAT I AM LOOKING FOR
Is it possible to reload only a certain list tile? Would you use another widget instead of ListView.builder? Other logic? Any help is appreciated.
Answer Extension [Update]
The marked answer is correct. I was using future builder and that was forcing me to reload all data always. By using different Streams with Streambuilder I am able to change data on database and it automatically changes on the UI, without updating the state! Magic.
base on what i notices, Future Builder is the problem, Future builder rebuild the whole widget in the ListView.builder. in your case use StreamBuilder and you see the changes you what...
I've searched all the internet, but found no similar resolved issues.
So, I'm playing around with Cloud Firestore and my issue is simply that I can't add anything to Firestore from console, I click on "Add collection", enter name, then generate random id for new document, and add a single string to it. After clicking "Save", nothing is added and screen still says "No data at this location yet". I tried reloading, logging off and in again, adding only empty collection, etc. Anyone knows what could be wrong? Maybe that's some bug because Firestore is in beta?
I was facing the similar issue, after a lot of research, I found out that there is an issue with chrome browser. Just open the same console with firefox browser, you will be able to do all the operations :)
I had the same issue. Try to go to the collection that you have created directly via parent path.
EDIT:
Sorry, I was wrong. Problem still occurs. Found out antivirus blocks these operations. I'm using kaspersky
Similar problem here. It works after I enable data collection on Kaspersky.
If there is no document in the collection, the collection disappears. The process is fairly fail-proof. You can enter 1 as the document name and 1 as the string field leaving the value blank and it will still write.
Try adding a different data type. Also, try and use one of the SDKs, the web (browser) or admin (Node.js) SDK to write (.set) data in a document firebase.firestore().collection("test").doc().set({"name":"john"}); with the test/open security rules in place.
NOTE:
Firebase does not accept undefined values by default.
Check your values: Having undefined values could well be the reason.
Following Xavi's advice, I found out that it worked on Safari, I then went back to the Chrome Firebase console and logged out of all accounts and re-logged in with the account I have Firebase access to, and I am now able to read and write from the console and also from my React app.
I use REST API to share articles/posts on LinkedIn Timeline and Company pages. To do so, I authorize my LI profile with the APP for accessing the profile info. As a result, could view the profile/image of a user in the APP. Everything worked fine until, for some time now, aren't able to view the user profile image from the APP. Now, it looks like:
Previous image URL starts with(accessible): https://media.licdn.com/mpr/mprx/0_
Current image URL starts with(could not access): https://media.licdn.com/dms/image/
On accessing the image in the browser,
Help me understand what has changed with LI. Thanks.
Are you injecting the URL in same way that's escaping it? The URL recently changed and has some characters that templating engines such as Handlebars will mistakenly escape.
If you inject the URL without escaping it, it should work just fine.
Check out this documentation. https://developer.linkedin.com/docs/ref/v2/media-migration,
The problem which I was facing was the image loaded sometimes, but after some days it would give above error.
The new id will be dynamic and can change from time to time. We recommend retrieving at least once every 60 days to update your media-typed URN.
In order to fix this, I save the image, the moment it is received on to personal storage(AWS S3).
I had been composing a series of sql statements inside the H2 Console. When I pressed execute, the page refreshed and I saw the initial logon screen, shown below. Using the browser history does not help: the H2 Console page insists on returning to the state shown below.
This is a serious usability issue - I will not always remember to do all of my work in a separate editor. Has anyone come up with a workaround?
Lost form data is also a problem for other web pages (bug tracking for example).
For Google Chrome, there is an extension Lazarus: Form Recovery. It "Autosaves everything you type so you can easily recover from form-killing timeouts, crashes and network errors."
I am using a webapp2 in GAE, when I called self.redirect to some page like below:
self.redirect(some_url)
which returned a page looks like cached, I have to refresh/reload the page so that I would get latest data.
Is there any cache setting for webapp2? or I have to set some properties for response of that page? Please advise.
In my project I've fixed that by adding time.sleep(0.1) just before the self.redirect('someurl') call.
Not sure if it is a best way to solve the problem, but pages started to show most recent info.
Edit: beware of consistency issue
Check out #Lindsay answer. Using time.sleep(0.1) might give you the expected result in a local environment, but you cannot trust it in a production environment. If you really need results to be strongly consistent, use an ancestor query, not time.sleep(0.1).
My guess is that this is happening because the earlier page is updating an entity that is then being accessed on the later page by means of a non-ancestor query. A non-ancestor query provides eventual-consistency rather than strong-consistency, so the problem is not that the page isn't being refreshed, but that it's showing what the data looked like before the update was completed. When you refresh, or add a call to time.sleep(), you may be providing enough time for the datastore to catch up, especially during testing. However, in production, your sleep may not be long enough in all cases, and the same is true of a page-refresh.
If you check your application and find out that you are using a non-ancestor query, and therefore your problem is indeed eventual-consistency vs strong-consistency, a Google search will show you that many pages discuss that topic; here's one: https://cloud.google.com/developers/articles/balancing-strong-and-eventual-consistency-with-google-cloud-datastore#ftnt_ref1.
The simplest solution seems to be to create an entity group and use an ancestor query, though that comes with a possible performance hit and a limitation of one update per second per entity group.
Got the same problem I have done a trick which is not good but helped me anyway. Called a temporary view file then did html redirect:
<meta http-equiv="refresh" content="0.5;URL='/'">
Hope it helps. any one with a better answer?
Do you call return immediately after the self.redirect(some_url)? It may be falling through to other code that renders a page.