Deleted field being used but not recognized as error in dynamic expressions?!?

Hi all,
I am experiencing what I am fairly certain is a bug and have already logged it as such but would like to get confirmation AND a fix if anyone has one.

I recently changed by User Type field from being a single value to a list. The original field was called user_Type and was defined as a Option Set UserType for data type.

The new field is userType and is a list of the option set UserType.

That whacky thing is that the data input into the new field is only working for one user - the first user created . I am able to add UserTypes for all the users that existed before the change and any new ones. However, all the userTypes added for all users other than the first user created show up as blank when you try to display them on a page. Those users also are rejected from the pages, that the assignment of those userTypes is supposed to give them access to (ie redirect on page load if UserType does not contain…).

So take four example users in the image below

The following image is the editor view of a page that should display their name, email and userTypes


Here is the result for two of the users in the list given above.

I have explained in a video - see link

If anyone has a quick fix for this, I would love to hear about it.

Thanks,

K

It is likely that the elements that display or not the data are expecting a single value while now the data type has multiple values.

As for them not showing…. Maybe the expression was showing one item while now the entry has a list of values, or …. there may be a privacy rules restriction ….

Seeing the preview helps see how things render but not seeing under the hood leaves one to wonder …. Perhaps showing screenshots or another short video showing the expressions and conditions may help folks here provide suggestions (including myself of course) :smiley:

Some thoughts:

  • Did you check permissions?
  • Does the order of the user types matter?
  • What if you create a new user? Does that work?
  • Do you have to run the Preview as the other users to see their data?

Hi cmarchan,

You certainly are on the right track. There is a privacy rule issue - what is troubling is that Bubble is not recognizing this as an error!

It is too late to do a video now - will try to put one out tomorrow.

For now I can confirm that there is an error in the privacy rules because it was looking for a deleted field just like the error I found yesterday. Remembering that I had meant to include this is what brought me back to my post just now. See image.


I took a snapshot of this on Friday because the deleted field was not recognized as an error in the error counter (note zero error count in banner).

However, taking off the privacy rule that uses the deleted field does not have the result that one would expect. I had discounted privacy rules being an issue because I had tested both new and old users with identical permissions (based on the new field - and they behaved differently).

Will give you the full view of the various expressions and conditions tomorrow.

Anyway, thanks for the suggestions - will dig deeper into this tomorrow.

Cheers,

Kevin

Hi @ken1 ,
*** Did you check permissions?**
see my response to @cmarchan - Permissions are part of the problem but not the total picture. Hope to have time to add more on this tomorrow - quite bizarre.
*** Does the order of the user types matter?**
re. order of user types - i like the way you think - had been exploring this myself and am curious to know if having too many userTypes could cause things to time out. But am pretty sure that this is nto the issue here.
*** What if you create a new user? Does that work?**
I have created new users and they do not work. will elaborate tomorrow
*** Do you have to run the Preview as the other users to see their data?**
none of the users really have their own data except for their actual user data which may be where the privacy rule I have set up could be causing problems but it is more complicated than one would think…at least it appears to be at this late hour. More to come tomorrow.
Thanks for your help.
Cheers
K

Hi all ,
Thanks to @cmarchan and @ken1 suggesting privacy rules as a possible source of my app misbehaving, I have found a way to move forward Both were correct in their suspicion that privacy rules could be causing the anamoly. I will be marking @cmarchan post as a solution because my request was a workaround and he helped me find it.

However, I want to highlight the fact that my conclusion is that while a problem in privacy was a key source of the error, that error was caused by a bug in Bubble that needs to be addressed as in different circumstances it might have gone undetected and could have seriously impacted the security of my app. .

I will be attaching this post to my updated bug report. The core issue was not a user error in the privacy rules, it was a combination of bugs. The reason that I did not consider privacy as a possible cause in the first place is bug number 2. It could also allow the error to go undetected under the right circumstances.

1.) Bubble is currently did not identifying input boxes that used the deleted field (User’s user_Type) as having an error.

2.) More concerning still, Bubble is continuing to use the deleted field in the privacy rules for users that had values in the deleted field user_Type.

This last point was highlighted by the fact that what on the surface looks like two identical users in terms of the roles (userTypes) they have in their list of userType are treated differently in terms of being redirected based on the uncorrected privacy rule (the one with the deleted privacy rule).

In the table of test users below, user 1 and user 4 have identical userTypes in their list of user types but are treated very differently before any corrections to the privacy rule that uses the deprecated single value user_Type field. I cannot show the redirect in a snapshot but the I embedded text that displays what the users name, email and userTypes should be. As you can see, user 1 and user 4 get very different results in terms of the text fields added and the banners that they are allowed to see.

Table of Users

User 1 and User 2 have identical permissions. but this fact is not reflected in the systems decision to show them menu items nor to even print out their userType information.

Menu When statement

editor view of debugging text added to navigation page

User 1

User 2

If anyone disagrees with my assessment of the bugs, please let me know.

Another shout out to @cmarchan and @ken1 for helping me figure out how this bug was affecting my app and by doing so allowing me to move forward.

If anyone believes that I might be mistaken in my conclusion that this is a bug, please suggest an alternate explanation.

Cheers,

Kevin

1 Like

As I mentioned above, while I have said that Carlos and Ken provided me with a solution, I continued to believe that the behavior that I was experiencing is a bug. I received note back from Support:

  1. confirming that the issue checker not identifying deleted data types (or fields) in dynamic expressions is a known issue

  2. offering some great best practices on steps to mitigate the issues that can arise from what appears to be a complicated issue to fix.

See below:
###############################################

Bubble Support

Jason here, from the Tier 2 App Design team, stepping in for Daniel.

This is a known issue of the Bubble editor where the Issue checker does not flags deleted datatypes in dynamic expressions as issues. The problem with deleted fields is that they are not really deleted until you decide to clean the app via the “Optimize application” button (Settings > General). The fields are not definitively deleted until then because it gives you the opportunity to restore a field if you had mistakenly removed it or if you decided that you needed it later on. Because of that, deleted fields do not trigger the creation of new issues.

However, we understand how this could be less than ideal when trying to debug the app. A few general tips that can help though:

  1. Before deleting a field, it is good practice to check the elements or privacy rules that use it. For elements, you can use the search tool to do that, and take the appropriate steps to ensure the fields are updated.
  2. If you already deleted the field but not permanently, restore the field and use 1)
  3. Another workaround, to make the elements appear in the issue checker, is to clean the app via the “Optimize application” tool. The (really) deleted fields will then break dynamic expressions, and you’ll be able to locate places to update. Be aware that in this case you will not be able to deploy this version of the app until you have solved all the outstanding issues.

I apologize for the inconvenience this may have caused but I hope this helps clarify what is happening.

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.