Storage not appearing in Chrome Debugger in Ionic 2 - ionic2

I'm using "ionic serve" to test my app on localhost:8100 via Chrome. I have Storage installed successfully and I'm able to read/write, but as soon as I restart the application, all of the data is gone.
I also noticed that when I go to the "Application" tab in Chrome Debugger, all of my Storage methods are empty. (Local Storage, Session Storage, IndexedDB, Web SQL, etc) I see other screenshots where people are able to see their persistent data in this area of Chrome Debugger.
When I run console.log(storage.driver) it gives me asyncStorage. Should it be saying something different? It feels like storage is just being written to memory, and not actually to a persistent storage.

Related

How to prevent GCP Cloud Shell from automatic popping up in console every time I open a page

Some time ago (a month or more) GCP Cloud Shell started to show up automatically every time I opened a page (some GCP page). It says it's reconnecting to the existing service. It happens even if I close the one on my first page. Then when I open a new page (for example, with Ctrl + Mouse Left Click in windows in Chrome) the Cloud shell automatically opens up again.
I would like Cloud Shell on the new page to be open only if I manually open it. Maybe I need to configure something somewhere. It's also bad because it uses the available quota for Cloud Shell, decreasing it without my will.
How is it possible to achieve that and disable auto-opening of GCP Cloud Shell?
Look at the URL in your browser. most probably you will find &cloudshell=true appended to it. remove that part and you should be fine.
Note:
When you open cloudshell. the mentioned part is appended with the value true. and when you close it, its value becomes false. if you have issues with that then most probably it's something with your browser.

Datastore Emulator Query/Issue

I have installed google datastore emulator in my local machine along with it written a sample spring boot application which performs crud operations on datastore.
When i hit the rest endpoints through postman i can actually see the data gets inserted in datastore in gcp console
can someone help me by clearing below queries:
1>Even though using an emulator in local , whether data gets inserted to actual datastore in cloud (gcp)
2>what is the purpose of emulator (if qn 1 is correct)
No data is inserted on Datastore servers, everything is local as mentioned here
The emulator simulates Datastore by creating /WEB-INF/appengine-generated/local_db.bin in a specified data directory and storing data in local_db.bin. By default, the emulator uses the data directory ~/.config/gcloud/emulators/datastore/. The local_db.bin file persists between sessions of the emulator. You can set up multiple data directories and think of each as a separate, local Datastore mode instance. To clear the contents of a local_db.bin file, stop the emulator and manually delete the file.
There are multiple uses for example:
To develop and test your application locally without writing actual Data to the servers hence avoiding charges during the development process
Help you generate indexes for your production Firestore in Datastore mode instance and delete unneeded indexes, that could be exported then into production
Edit
In order to use the emulator on the same machine it's recommended to set the environment variables automatically as mentioned in the documentation

Deletion notice for my Google Cloud Shell home directory

I got a deletion notice for my Google Cloud Shell home directory. Does that mean that my data will also be deleted?
This is documented here:
If you do not access Cloud Shell for 120 days, we will delete your
home disk. You will receive an email notification before we do so and
simply starting a session will prevent its removal.
This only applies to the home directory of your Cloud Shell instance (you may want to store it on Cloud Storage anyway if you want to keep it). Any other Google services you use will be unaffected.
Considering i'm paying for their services this is extremely annoying. Lost a lot of important documents and feel like taking my business somewhere else.

How to only push local changes without destroying the container?

I have deployed my app (PHP Buildpack) to production with cf push app-name. After that I worked on further features and bugfixes. Now I would to push my local changes to production. But when I do that all the images (e.g. profile image) which are being saved on the production server get lost with every push.
How do I take over only the changes in the code without losing any stored files on the production server?
It should be like a "git pull"
Your application container should be stateless. To persist data, you should use the offered services. The Swisscom Application Cloud offers an S3 compatible Dynamic Storage (e.g. for pictures or user avatars) or different database services (MongoDB, MariaDB and others). If you need to save user data, you should save it in one of these services instead of the local filesystem of the app's container. If you keep your app stateless, you can migrate and scale it more easily. You can find more information about how your app should be structured to run in a modern cloud environment here. To get more information about how to use your app with a service, please check this link.
Quote from Avoid Writing to the Local File System
Applications running on Cloud Foundry should not write files to the
local file system for the following reasons:
Local file system storage is short-lived. When an application instance
crashes or stops, the resources assigned to that instance are
reclaimed by the platform including any local disk changes made since
the app started. When the instance is restarted, the application will
start with a new disk image. Although your application can write local
files while it is running, the files will disappear after the
application restarts.
Instances of the same application do not share a
local file system. Each application instance runs in its own isolated
container. Thus a file written by one instance is not visible to other
instances of the same application. If the files are temporary, this
should not be a problem. However, if your application needs the data
in the files to persist across application restarts, or the data needs
to be shared across all running instances of the application, the
local file system should not be used. We recommend using a shared data
service like a database or blobstore for this purpose.
In future your problem will be "solved" with Volume Services (Experimental). You will have a persistent disk for your app.
Cloud Foundry application developers may want their applications to
mount one or more volumes in order to write to a reliable,
non-ephemeral file system. By integrating with service brokers and the
Cloud Foundry runtime, providers can offer these services to
developers through an automated, self-service, and on-demand user
experience.
Please subscribe to our newsletter for feature announcements. Please also monitor the CF community for upstream development.

Google App Engine & Django Sandbox: Shell and Web seem to be using different datastores?

I'm new to both Django and Google App Engine, and am using a sandbox in OSX10.6 with the GoogleAppEngineLauncher. I've got a basic "bookstore" application running from the tutorial in the OReilly "Programming Google App Engine" book.
Here's the bug: If I add a new object to the datastore through the web interface, then it's readable through the web interface, but does not appear to exist if I query the datastore through the shell. Vice versa: If I add an object in the shell, then I can read it from the shell, but it doesn't appear in the web interface.
A related curio: All data vanishes from both datastores when I reboot my computer.
Any thoughts or theories would be welcome. Thanks!
=T=
If you use the remote API shell and point it at the instance you're running on your machine, you should get the same datastore. It's unclear how you're accessing your app via "the shell", but it seems that you're creating a second instance to do so.
The data vanishes from the datastore when you reboot your machine because by default the datastore file is created in /tmp; you can specify another location (one that the system doesn't clean for you on reboot) for it when you run dev_appserver.py.
That's right, python manage.py will get you to another instance of the app (and another datastore) than the Launcher. If you'd like a command-line interface with your application, see How do I activate the Interactive Console on App Engine?, or run the dev server solely from python manage.py runserver rather than the Launcher and continue to use manage.py shell.
I've been bitten by the same datastore deletion. App Engine, for some reason, needs to close shop carefully -- you have to hit "stop" (or hit ctrl-c if running from the dev_appserver.py command, typically on linux) to have the datastore save properly to disk. If you turn off the computer before properly closing out, the datastore will be deleted.