Vue composition api: ensure variable is not null

I ran into a problem where I was loading data from the backend in App.vue and when loaded that data would be inserted into a vuex store and in another component queried.

However the loading took longer than expected and a data race happened. The route destination rendered faster than the backend could deliver data and it to be stored in the vuex store and returned.

Concretely I loaded a profile of the logged in user with vuex-orm and the axios plugin.
In order to grab the profile data I used

I wanted to update location data of that profile if it was different, which was done with a promise, because that’s how the cordova api works.
But profile was always null. And I tried ref() and reactive() but finally solved it with watch().

So whenever profile changes the location is updated. Of course I have checks to not update if it’s not required.

The initial state of profile is null, then it changes and updateProfile is called with the new value.

Upgrade Keycloak Standalone with Postgres from 16.1.0 to 17.0.0 with custom port behind nginx reverse proxy

What a nightmare.

You’re using keycloak and are upgrading from Wildfly 16.1.0 to Quarkus 17.0.0.
You’re also listening on a non-standard port, that isn’t 8080, but 23232.
You’re using a reverse proxy like nginx for TLS
and Keycloak is connected via plain http with nginx.

Grab your standalone.xml found in /standalone/configuration/standalone.xml
and find your postgres jdbc connection string as well as postgresql username and password.

edit conf/keycloak.conf

With this everything should work as before.

You also have to upgrade your Java version to be at least v11. Keycloak 17 won’t run with v8.

centos 7 & mysql 5.7 gpg key error proper solution

If you’re running CentOS7 and using the MySQL 5.7 community rpm package you might’ve ran into this error response:

Seems like Oracle has changed their GPG key and it’s not uploaded to gpg servers yet, at least yum can’t find the new key.
So you have to manually replace your key.

Disabling gpgcheck is a very bad idea and should never be done, despite what some chinese blogger suggests for a solution. (https://www.cnblogs.com/minseo/p/15835416.html)
The proper solution is to take the key from the mysql5.7 gpg signature checking documentation page and replace the current contents of /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql with this key.

I will replicate the key here, but be sure to check mysql5.7 gpg signature checking documentation page for the current signature.

DO NOT DISABLE gpgcheck as suggested in the chinese blog.

ionic vue invalid host header solution

You’re doing ionic with vue and are receiving an invalid host header message, black letters on white background.

Create a file vue.config.js in the project root and past this content: