Hi Joe, hope you are well. I’ve implemented a variation of this. But still confused on anonymous users. Will this track them? I add this to a list but even on mobile and save, on refresh it clears the count and colour. Any thoughts?
@NoCodeAcademy Жыл бұрын
Hey Costas, great question. Excuse the slow reply here w the holidays. If anonymous users have the ability to vote, consider a different data structure than the one suggested in the video of counting the list of users. Instead, store the upvote value as a numerical value on the item and do a 'thing's current value + 1' operation on it every time the upvote button is hit. That's interesting because Bubble will cookie anonymous users and create a temporary user so you can still attach data to them -- see manual.bubble.io/help-guides/data/user-accounts#temporary-users. What's the conditional like on the upvote? Does it have that item in a list that is tied to the user record? If a user (even temporary one) has a list of items they have upvoted and the conditional checks that, it should work. But if not, the truth is in the real-life testing. Check what exactly is the conditional as a first step though? To spur another line of thinking, what's to stop someone from gaming the system as an anonymous user visiting the page in an incognito browser to skew any upvote system to their favor? Hope that helps in some way.
@costsia Жыл бұрын
Thanks Joe. Sorry for late reply also to thanks. I’m check this out and get back if I have questions
@eliodrallag48062 жыл бұрын
Thus it make the post record loaded with user objects?
@NoCodeAcademy2 жыл бұрын
Hi Eli - there is a repeating group that loads all the records of type Post from the database. See 0:50 for how it's loading in the posts, then see 0:55 for the 3 posts in the database. Hope that helps.
@kingpinoftherails9262 жыл бұрын
Great, thanks.
@NoCodeAcademy2 жыл бұрын
You're welcome
@jamesid29 Жыл бұрын
Love the tutorial and explanation. Quick one, from an efficiency standpoint, wouldn't storing a list of upvote users in the database field make querying the database slower as the list grows. I mean if we have thousands of people upvoting a particular product and all these users are stored in the list, wouldn't data that affect querying the post content at some point. I'm just starting to learn Bubble so i hope question is clear. Thanks
@NoCodeAcademy Жыл бұрын
Hi James, good question and I believe it is clear what you're asking... but to state back for understanding, you're essentially describing a scenario in which you'd have dozens or 100s of products and each has 1000s of upvoters attached to them, and the concern is that it'd be carrying along a whole lot of extra data on the page? Yes, that is a good point. Another way you might give a go to accomplish the same thing is each time a user upvotes a product, store all the upvoted products on the User record in a list. Then, when the product is found within the Current User's list of upvoted product, it'd know to change the UI from gray to orange. And for tracking the number of upvotes just use a simple number on the product record. My Bubble expertise in these days is more MacGyver-esque in which I'll show a way to get the job done versus having the perfect answer for every scenario in Bubble. Hoping to get there some day :) but wasn't going to wait to start making videos. So thanks for this point, I think this new way would be a better way to do it in the long run, with the caveat I haven't rewatched this video to consider this particular challenge from all angles. Lastly, I wouldn't worry too much about these finer points at the beginning of one's Bubble journey, unless you happen to be learning it as a skill to build apps for others, which then it's more important... but if it's for an MVP app, it'd be an amazing accomplishment (or problem?) to have 1000s of people upvoting a particular product on your app. And if you were able to accomplish that, you'd likely have cash flow at that time to devote to a seasoned Bubble developer who can help you squeeze out all the efficiencies necessary to make the app run as optimally as possible. Good luck.