I've inherited some Electron-based application, which is running a Vue.js app. After Let's Encrypt decided to update the root certificate (https://letsencrypt.org/2021/10/01/cert-chaining-help.html), our application stopped working the way it should.
Our Electron application needs to establish MQTT connection to a broker and that part has stopped working.
The fix seemed to be trivial, just update the electron from version 8 to a version where they patched things up (13.5.1) and I should be good to go. The MQTT connection part was fixed, but some other problem pops out.
The part that is currently not working is when the route is switched.
Here are the routes def:
const routes = [
{
path: '/',
name: 'Home',
component: Home
},
{
path: '/connections',
name: 'Connections',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '@/views/Connections.vue')
},
{
path: '/about',
name: 'About',
component: () => import('@/views/About.vue'),
meta: { hideAppBar: true }
}
]
const router = new VueRouter({
routes
})
As you can see, nothing special. I am thinking that the issue is with the fact that for some reason we are manually navigating to a different page.
function navigateToURL (win, path) {
if (process.env.WEBPACK_DEV_SERVER_URL) {
win.loadURL(`${process.env.WEBPACK_DEV_SERVER_URL}/#/${path}`)
} else {
win.loadURL(`app://./index.html#/${path}`)
}
}
We have this navigate to URL function which gets invoked with connections path. Once the URL is changed, the event did-finish-load should be fired, but that never happens. This part is working fine with Electron 8. And also the event is fired for the / path.
I tried changing the mode to history in the Vue.js router, and also removed # from the navigating to the URL function. Once that change is made, the did-finish-load method was fired, but the created function for the Connections view was not invoked.
Also, I've scaffolded Vue.js-electron app and I didn't see the reason to have this navigate to the URL function that we have, so I am thinking that the app is not well written. I would like to avoid refactoring it, so this post is my last try to avoid doing that.