Comments (11)
This is the normal behavior AFAIK. New versions are loaded only after a cold start.
firebase_image/lib/src/cache_manager.dart
Lines 113 to 116 in 7c5234e
I suspect because of the RAM cache, which is renewed only with a restart.
from firebase_image.
But does shouldCache:false not make sure to force a new read of the image and not use the cache ?
from firebase_image.
How can I make sure to get the latest uploadet image I just updated or created from Firestore when I read it again the first time ?
Please be aware that I use the same name every time. Fx. "profileimage.jpg"
But I gues you compare with metadata create/update date so I should get the latest image. But this is not what is happening. I only get the old image.. ?
from firebase_image.
Firebase does not allow for us to listen to changes in a bucket in the same way we can for Realtime Database or Firestore. As such, the code will manually check the metadata for changes whenever the widget is rendered.
If you're bucket changes are somehow linked to Firestore (e.g. image upload triggers a Cloud Function then the Cloud Function updates Firestore), then you could write some code that listens for changes in Firestore and re-render the widget whenever there is an update.
Hope this clears things up!
from firebase_image.
Thanks, but I actually DO re-render the widget but still get the old image from cache and not the newest. Is there a way to force a get of the newest image and not use cache locally ? I tried "shouldCache:false" - but it gives me old cache image, not the image that is actually stored online?
from firebase_image.
I'm trying to work through this as well. A cold restart is required to update the image. @janlektonen, i'd love to hear if you found a workaround. @mattreid1, the image is not seeming to evaluate on widget rendering. It only seems to be evaluating on start up. I'm referring to iOS btw.
I have tried snuffing the tempDirectory/firebase_image , all kinds of work arounds, and I can't seem to come up with a good solution to get FirebaseImage to refresh on widget rebuild when the storage image changes. It just won't do it. It seems to be that it's on a timer of sorts...but maybe this is coming from the iOS RAM as @morphy2k said? But If you can't over-ride it by completely deleting its temp directory, as I tried, what solution is there?
from firebase_image.
@jbryanh, I haven't found a workaround for this. I think it could be that the newest flutter-package update from firebase might have influenced the way this package reads and handles cache from Firebase? But i'm just guessing.
I would be nice if the "shouldCache:false" just does what it is supposed to do when updating state on the widget.
@mattreid1, My solution to developer: If you reload/update state on the widget and "shouldCache" is set to false, then the image should reload from Firestore no matter what and bypass cache completely and reload image again over network from Firestore.
So I'm hoping that it will be fixed soon, please ;-)
from firebase_image.
Seems to me the issues would be related. Whether shouldCache is set to false or not, on widget reload, the image should update if the image at Storage has changed, which it does not. For now, I've had to just drop the plugin so that images will refresh properly. Would sure rather use the plugin though. It's a very helpful plugin, and a huge thanks to @mattreid1 for developing it. I couldn't unwind what was keeping it from replacing the cache image myself, so I sure won't criticize.
from firebase_image.
Yes, it does not work, just testet it again if it would refresh new images. But still shows old from cache, even though I force it to download with shouldCache: false.
@mattreid1 I hope you can have a look at it and see why it does not refresh when metadate change in firebase storage ?
from firebase_image.
This is the normal behavior AFAIK. New versions are loaded only after a cold start.
firebase_image/lib/src/cache_manager.dart
Lines 113 to 116 in 7c5234e
I suspect because of the RAM cache, which is renewed only with a restart.
@mattreid1 Would there be a working solution around this to get it working without a restart?
from firebase_image.
I think these cache plugins are GREAT if you just need static images loaded at start up that aren't dynamic or won't change in that session. I had to drop the plugin and use firebase to record the createdTimes...firebase became my repository of MetaData for images instead of Storage. That way I can compare and reload images whenever I want during widget rebuilds. Feels wonky still, but I just don't want a unique metadata read on every widget build, and I can piggyback the meta info in existing firebase docs i'm already streaming.
from firebase_image.
Related Issues (20)
- Resolve Incompatibility with firebase_storage ^5.0.0 HOT 2
- Update firebase_storage dependency to ^7.0.0 HOT 7
- In my flutter application user has to submit or upload 3 images and 2 PDFs randomly. HOT 1
- Feature request: easy way to pre-cache by url HOT 6
- Update Firebase dependency HOT 3
- Warning: Operand of null-aware operation '!' has type 'String' which excludes null. HOT 7
- path with spaces returns object-not-found HOT 1
- TypeError (type 'Null' is not a subtype of type 'Reference') HOT 15
- Null Safety isn't done very well. HOT 1
- Invalid argument: Instance of 'Reference' HOT 1
- Any reason this won't work with Flutter Web? HOT 2
- Optional placeholder widget while loading HOT 2
- Web Support HOT 1
- /C:/Users/kuk/Documents/sdk/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_image-1.0.1/lib/src/cache_manager.dart:29:13: Warning: Operand of null-aware operation '!' has type 'String' which excludes null. join((await getDatabasesPath())!, dbName), ^
- update dependencies HOT 4
- umlauts seem break the plugin
- Exception: download-size-exceeded
- Icon progress indicator
- Package needs dependency updates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase_image.