Fishy behaviour on app inclusion and log file app name in parent child relationship

Hi,

I loged this once before and may not have done a good job of explaining it, but I want to log it again, as I still suspect there is something fishy here.

I made some apps and saved as user apps in the app code section. I saved only one instance of each app. Note that the app now called 'House Climate Control - Meteorology Manager' was initially called 'House Climate Control - 24h Average Temperature Calculator' on creation.

I created all apps as stand alone apps and then converted them into a parent child relationship as displayed below. Having entered the then called 'House Climate Control - 24h Average Temperature Calculator' into the parent child relationship, which was the first app to be added, I noticed that an instance of the app still existed unattached to the parent. After having changed the app to belong to the parent child relationship the one app now was represented in Hubitat as two apps, one in the parent child relationship and one as a stand alone app.

If I do a mouse over the app name I get, what I think is, the appIDs, which are different. But if I change the name of one of them, the other changes name too. So it looks like they are linked somehow.

As I continued to develop the app, adding more and more functionality, I decided to change the name of the app from 'House Climate Control - 24h Average Temperature Calculator' to 'House Climate Control - Meteorology Manager'. I did this change using Visual Studio Code publishing it to Hubitat while providing the correct app ID, i.e. keeping the same instance of the app while replacing the code and giving it a new name. The new name has been accepted in all places but one, in the log section.

My original post was about why the apps appeared as duplicates in the log file view, which they still do. This is perhaps not strange if they infact are two different apps (different appIDs) even though I only created one of them.

The first stand alone app still announces log information from the file as it looked at the time of the merge into the parent child relationship. The second app with the same name is the child app which I expected to remain as it has the same ID as before, but with a new name. But as you can see, it hasn't changed its name.

I don't think I see anything unusual in your screenshots above, except maybe something odd related to this first thing.

You can't convert an existing (installed) "standalone" app into a parent/child app. You can change what the app code does, and future installs will use any parent/child relationships created after that. Existing installs will generally still work, and I don't remember seeing anything odd in the limited testing I've done, but I'm not sure I'd recommend making this kind of change without reinstalling given that it can be a drastic change for an app.

If you truly only installed one instance of your app but are now seeing both the parent/child and "standalone" apps in your list, that could be why (though it's also not something I ever remember seeing before).

Where or how are you changing the name? There are two places this could come from: a label prompted for in your app UI (similar to input, somewhere the user can type something) or a updateLabel() call in your app code that sets the name however it wants. If neither is specified, it will use the name from your app metadata. It it would not be unexpected for that change to change both if you change it in the code.

Log entries do not necessarily show the current app name. They will show the first (oldest) name in the logs file. This will eventually get purged out and replaced with a newer name if if changed. I don't see anything from your screenshots to suggest that what you're seeing is unexpected.

1 Like