Issue with Unexpected Changes on Production

On this screenshot, it's evident that on Production, version 3.6.2 of the query contains

CONCAT(
certifications.name,
CASE (
SELECT grade_levels.name
FROM grade_levels
WHERE grade_levels.uuid = certifications.grade_level_uuid
LIMIT 1
)

And in the latest version of this query, we have the following changes:

DISTINCT CONCAT (
subjects.name,
CASE (
SELECT grade_levels.name
FROM grade_levels
WHERE grade_levels.uuid = certified_subjects.grade_level_uuid
LIMIT 1
)

As you can see, on Production, the query contains the latest changes, even though it's version 3.6.2.

Please note that it was published on May 13th, and currently, these changes are already reflected in Production, causing errors for us.

Because on Production, we don't have the certified_subjects table, and we should be working with the old code that was released on May 13th. However, in reality, we are working with the latest version of the query on Production, which shouldn't be the case (this is shown in the compared changes).

In our live version, we are getting code from the Staging environment. As you can see, all queries work correctly on the Staging environment, and there are no errors.

And as you can see, there is an error in the Production environment.

Best regards,

Bohdan Martynenko
Tutorpeers

Hello @Bohdan_Martynenko!

When you are editing an app, you will always be on the latest version of the app.

The releases and environments features can be confusing, it seems you are editing the application, where you are seeing the latest version which is expected.

I have been reading into this issue as I have been having my own trouble getting things understood. This blog post was really helpful for me to understand this better.

When you push to publish a release it will update to the latest version, but when you are editing the app it will be building on top of/in front of the head of the app where you might have to change the query to test with the table you want and then push to live once things are working as intended.

There is more info on this in our docs here which I highly recommend reading. Let me know if either of these two were able to clear up some of your confusion!