Can I prevent background sync of firestore from old version client? - firebase

I want to control background sync of google-firebase's firestore db with persistance mode (PersistenceEnabled to true).
I'm afraid the old version client, works offline and don't know the app's version-up (with some destructive updates), may upload local-data to server when change to online.
In this case, I want to check current app versions and allow/not allow before sync.
Is there any solution?

Data in the cache is only updated when you attach a listener/observer to it. There is no automatic synchronization happening for the data in the offline cache.
This means that you can add a version check to your application startup code, before you attach any observers. Simply store a database-version field in a global document, and check against that upon application startup. If the version is greater than what the app was made to handle, show an upgrade prompt.

Related

sync version of ProtectedLocalStorage/ProtectedSessionStorage for server side

I'm migrating a legacy application that was previously using one SessionState class to track the session variables. Now I changed it with ProtectedLocalStorage/ProtectedSessionStorage to keep the state. But I need some sync methods to get/set in storage.
While I'm using protectedLocalStorage.getAsync(key).getAwaiter().getResult() (it's not good, but i want min effort to run the application). But this solution isn't working, the task is never complete.
Blazor webassembly has sync versions but for server-side options are not available.
Please suggest any solution where I could get and set sync.

Xamarin.Forms Application.Current.Properties retained on application upgrade?

We're using Application.Current.Properties to store settings data for our app.
When we release a new version of the app to the store (Apple App Store and Google Play), are these settings retained or cleared?
I've just run a test by distributing two versions to HockeyApp - both for iOS and Android - and the values stored in Application.Current.Properties (note, not Settings from any settings plugin) are retained on installation of the updated version.
This is good news for us and our customer!
See this thread in the Xamarin Forums
No, all values in the name-value dictionary are serialized to disk every time when the application goes to sleep. They are read back when the application is loaded again.
The data of your app is - generally speaking - not cleared when you install an update (it is deleted when the app is uninstalled), cf. here, here and here. Hence App.Current.Properties should be maintained when updating an app. But you can easily try it. Publish a beta on HockeyApp, TesFlight or whatever, update the app and see what happens.

How does Meteor.js detect changes in MongoDB or Mysql?

How does Meteor.js detect changes in MongoDB or Mysql? Does it add triggers, or does it poll for changes? If if polls for changes then this seems a rather expensive operation
Update
I also found an explanation on the Meteor site after some more digging around:
https://www.meteor.com/livequery
For MongoDB, Meteor tails the operation log (oplog) for changes. In production, this requires the database to be set up as a replica set (a one-member replica set is fine); if it isn't then it will fall back to polling. In development mode, oplog tailing is enabled by default. For more information, see this (slightly out-of-date) wiki page.
There's no native MySQL support in Meteor. There are packages which add MySQL support, but you'll have to read those packages' documentation to see if it uses triggers or polling.

How to perform specific operations during installating or updating a TideSDK app?

I went thru the docs but couldn't find how can I perform specific operations when app is being installed or when app is being updated.
What I want to do is, create table when app is being installed and if in future, db schema changes, I want to perform those operations when app is being updated.
According to me .. the best place to do these changes are in the code. so whenever the application starts up first time after getting updated.. you do all the db schema changes.
This makes sure that your application is fully updated before you touch any database and secondly u do not have to write any special logic separately while installing / updating the application.

Creating a database in the blackberry device when the app is installed

I want to create a database on my blackberry device when my app is installed. I did not find any event (e.g. onInstalled) so that i can create my databse on this event when the app is installed.
Apparently there is a method DatabaseFactory.exists() which i can use to check if the database exists or not. But i do not want to check for this every time. I want to create the database when my app is installed and when the app is un-installed then the database should also get deleted.
Thanks
As far as I know RIM API SDK does not provide mechanism to catch install/uninstall events.
And even the database is once created it can be deleted/damaged via the filesystem. For instance user deletes database files from the media-card or from the device memory. Just because user does not know what these files contain and assumes these as temporary or something else.
It is a good approach to check the database presence before starting work with it. Otherwise user may get blank white screen with text "Exception 1234" and some additional text, or may get a popup with strange message, like "Error: FileNotFoundException...".
See the SQLiteDemo in the blackberry samples demo then you can get solution.

Resources