Is there a hidden link between an original app and it's clone?

Hello

I’ve found some unexpected behaviour, and I’d like to know if should have expected it.

I have an Anvil app for storing and plotting sensor data from my greenhouse (everyone needs a hobby, right?). I’ve got a Pi Zero sending the data using Uplink. Works a treat, could not have found an easier way to do this - thank you Anvil!

Anyway, I have a second Pi Zero that I use for testing code as I add more sensors or even actuators, one day. So I cloned my Anvil app so I can send data to the Clone, try out new web app features (buttons, warnings ,etc). I’ve generated a new Uplink key for the second Pi Zero from the clone.

But, when I send data from the second Pi to the Clone web app, that data is appearing and being displayed on my Original web app. I can’t work out how this is happening.

Is the data table the same, for the Original and the Clone?

EDIT: Could it be something to do with needing to disconnect the Uplink link?

Thanks in advance
Jon

You can check the Uplink keys for both apps and see if they are the same. They shouldn’t be though as far as I remember.

The keys are definitely different. I just wasn’t sure if there was some left over Uplink link from before I changed the keys :thinking:
I don’t know. It’s a strange one and I can’t work out how to stop my development Pi sending data to the data table for the real data, instead of just to a test table.
Coupled with that, I’ve noticed that the test table is also being written to by the live data from the Pi in the greenhouse.
I think I might try resetting the Uplink keys for all of the apps.
Jon

It sounds like your two apps are sharing one or more Data Tables. This is, in fact, allowed, and can be very useful, for some kinds of apps. See Sharing Data Tables Between Apps

But it is not always what you want.

First, verify that sharing is occurring. Then, if it is, decide which app gets to keep the table. From within the other app, delete the table, and re-create its structure.

If tables are interconnected by Link columns, then I would advise thinking things through, start to finish, before attempting any changes, to tables at both ends of each Link.

1 Like

Thanks for this insight. I’ll investigate the tables. This sounds like what is going on.

I think I’ve seen what the problem is.
I’ve just noticed in the Data Tables view that a table has both the tab name, and then there is a “python name” as well. This python name was the same for both tables - “raw_data” (tab name) was the original data table, and “test_data” was the new table for the clone of the original app.

Prior to noticing the above, I deleted the “raw_data” tab from my data table in the clone of the original app. Unfortunately, this has deleted the “raw_data” table from the original app as well. So I can no longer see all the data that was part of my original app (goes back about 12 months). However, I have a plot on my app that can choose between data from the last hour, 24 hours, 7 days or all data. When I hit all data, it still plots data from 12 months ago.

I’m so confused…

Hi @guitarmanjon

This does sound like very odd behaviour. Before you touch your app again, please can you DM me a link so I can work out what’s going on here? I don’t want you to accidentally lose your data, and we’d really like to get to the bottom of the issue.

Thanks!

Hi @daviesian
Message sent.
I’ve found that all the data is still there by downloading a CSV of the data. But the behviour is still strange. If you can give me any insight as to what’s going on (i.e. what I’ve done wrong most likely!), it’d be much appreciated.
Thanks
jon

Technically, as long as some app, somewhere, incorporates a database table, the table will stick around. This gives you a way to create a safety net: clone or create an app, and then add tables to it from your other apps. Specifically, add tables that you want to preserve.

Just to update the thread - Ian Davies has very kindly helped me resolve this over some direct messages.

The issue was cause by me being lazy and using the “Tables from other apps:” option when creating a new table to save me writing the column headers out again. When you use this option, the table is connected to both apps, which I can see as being really useful for some applications. Just not what I wanted here.
image

Many thanks to @daviesian for helping me out.
jon

1 Like

I see. You thought you were getting just the table’s structure, not the actual table itself?