My app has privacy rules to protect users from seeing each other’s sensitive data. These rules are lifted when current user = this user, mostly for the purposes of auto-binding and workflows.
In these two screenshots, the first is right after logging in and trying to access the data.
The second screenshot is from reloading the page in a different tab, and the correct rules apply.
Am I missing something here?
Privacy rules are evaluated on page load…
Yikes. Kinda sounds like an impossible situation as I have a single page app
It’s trivial to create a separate login/signup page and redirect them to your app.
Everything is on one page so there’s no redirecting. Imagine if someone had a popup group that functioned as the log/signup workflow.
I wonder what the suggested build scenario would be there.
But why? Just redirect them to a login page. If you want them to return exactly where they were, send some URL parameters so that after they login/signup they’re redirected to your SPA and a workflow opens all of the stuff they had open. You’ve said ‘everything is on one page so there’s no redirecting’ but that’s a design choice - you can just redirect them and yeah it might be annoying that you can’t have a perfectly-single-page-app, but it makes no difference for the end user which is what matters.
Yeah… or just refresh the page once they log in… it’s really no big issue.
I’m guessing you’re not very familiar with single page apps. It’s a good 7 seconds to load a complex app on mobile during page-load. Then I’d have to reload the page oncemore after their account is created and have the user wait another 7 seconds while I reload the page.
It’s just yet another workaround for trying to build efficiently on bubble.
The Sign Up Page also functions as the Edit Your Profile Page, so it’d be a huge hassle to duplicate and then separate the two pages, especially on my timeline.
If you look at Instagram, Twitter, Snap, etc, you’re allowed to edit your account on the fly, and even after creating an account, you’re pretty much thrown into the mix of things just like that
Having a 7+ second redirect definitively takes away from the experience I’m trying to offer.
Oof. Both of them are very experienced Bubblers and I’m very sure they know how an SPA works.
Anyway it’s weird that it your privacy rules dont work. I have a similar use case but don’t experience any issues. How did you setup your privacy rules?
If you need a rule to enable autobinding, you can always add additional rules to the datatype to enable autobinding.
I’ve been programming an SPA since 2020 and hardcore for the past 6 months. Honestly, the general consensus has always been that SPA’s struggle in page-load times.
I do my best to optimize the user experience, and something as early as the signup page is essentially first impressions territory. I’d really rather not gamble on “it not being a big deal” especially since I already have a 5 second or so long workflow at the end of the signup page already. (We use a search service and I have to update the records whenever user data gets changed)
I recently converted the majority of my datatypes into Data Containers, as in instead of saving all profile information on your Default Profile Data Type, there’s a Satellite data type called “container” who stores the things that other users have no business seeing.
My current rules block other users from seeing the User’s Data Container.
If that’s the case then can’t you just load a User’s Data Container at a point you can verify the Current user? That’s pretty much what I do when it comes to loading my satellite datatypes.
Actually… it’s not strictly correct that privacy rules are evaluated on page-load (as I previously said)…
Rather, they are evaluated when the data request is made (which will often be on page load).
So there are (at least) 2 simple ways to avoid having to refresh the entire page.
- Just refresh the relevant datasources when the use logs in (or logs out)
- Just use conditions on your datasources, so that they don’t make requests until the user is logged in.
Sounds like it could be a backend workflow by the way, would help your UX.
This is true. It needed to be front-end in other areas of the app, but in this scenario, backend would be much better
This topic was automatically closed after 14 days. New replies are no longer allowed.