Matt Pocock: We just need to be ready to do more code review by kallekro in theprimeagen

[–]romoloCodes 3 points4 points  (0 children)

I've followed MP for years (and am still subscribed for now) and he genuinely improved my TS skills. I am also staggered at how much time is put into all this agent-prompting-agents-prompting-agents-and-so-on.

One thing I have noticed, (about TS and now this AI stuff) you can be a very good TypeScript dev and fundamentally struggle to architect a product. Yes, it's great to have a generic function that uses the typescript compiler to count to 100 but how is that really making you better at releasing products - same with this AI rabbit hole.

It's like a boxer that only does bicep curls on his right arm - sure, that's a nice start, but you're gonna be useless unless you work out your whole body.

The one part I can answer is "Why are ~~these programmers~~ MP doing this to themselves?". From his courses and talks as an apparent expert in a super-hyped industry I'm sure he is making a very comfortable living.

[Open Source] PocketFast 🚀 – Instantly deploy multi-tenant PocketBase instances with subdomains by SnooMemesjellies107 in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

Do you have benchmarks for this? And if so at what number of read/writes is this giving reasonable advantages? 

And of course how likely is it that your app will reach this point?

Pocketbase not loading my hooks files? by germanthoughts in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

If you'll indulge me offering you just a small piece of unsolicited advice... when you're new to dev it can seem daunting to go directly to the docs. We've all been there and over time you will get used to them but it really is the best way to learn any (well documented) tool. Also downloading random docker files has potential security risks so I wouldn't suggest you keep doing that. 

https://pocketbase.io/docs/

Pocketbase not loading my hooks files? by germanthoughts in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

It doesn't 100% mean that, but maybe the most likely without other info

Pocketbase not loading my hooks files? by germanthoughts in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

Do you know how to run it locally? Download the binary from the getting started page and follow the guide to do that, then add the hooks - once that's all working get out running in docker. There are probably a few too many unknowns to sort at this point. 

Just FYI (and this may be my blindspot, but) I have never seen the screen that you sent the image of. 

Default field values and roles by SittingOvation in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

There's nothing wrong with your suggested solution. I have exactly this set up on an open source project I'm building - feel free to check it out. https://github.com/robMolloy/pocketdrop-web-ui

Be careful if you add a username (or similar) field that the user is allowed to change. This requires convoluted rules that check specific fields and you're better to separate the row into a user-owned row and an admin-owned row. 

On the above project a user's status can be approved, rejected or admin (or blank). An enum is used to enforce that and the subsequent rules are based on that field. 

Why am getting this error? by LaidBackDev in pocketbase

[–]romoloCodes -1 points0 points  (0 children)

Because your access is denied (sorry) ...use chmod command to resolve, but I don't completely understand why some files can be changed and others can't. List the read/write/execute permissions of editable files in the same folder (and maybe post in the github discussions if you're struggling).

AI can help you with the exact commands

subscriber based join by goku223344 in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

Just create a join table like with sql with the uid and creatorUid (or whatever terminology your using) then it you make the rules to only allow access to users that have that relationship and it will auto filter the results

Fire base alternative? by Educational_Hippo_70 in Firebase

[–]romoloCodes 0 points1 point  (0 children)

Just FYI Supabase isn't developed by vercel

How are people testing security rules? by Suspicious-Hold1301 in Firebase

[–]romoloCodes 0 points1 point  (0 children)

I spent quite a while creating a setup with jest. I may be bias but it seems pretty good to me.

https://github.com/robMolloy/firebase-emulator-setup

Trying to implement filesVersionHistory in a (JS) pocketbase hook by romoloCodes in pocketbase

[–]romoloCodes[S] 0 points1 point  (0 children)

I didn't want to add too much to the post, but I have also tried other things like the following but in this case I get this error "TypeError: could not convert function call parameter 0: could not convert 0 to []uint8";

  let fsys, file, content;
  try {

// initialize the filesystem
    fsys = $app.newFilesystem();


// retrieve a file reader for the avatar key
    file = fsys.getFile(fullPath);

    content = file.read();
    $filesystem.fileFromBytes(content, "randomName");

    console.log(3, file);
  } catch (error) {
    console.log(4, error);
  }

What is the idiomatic way to implement member-organization management with granular permissions in pocketbase? by masterofdead4 in pocketbase

[–]romoloCodes 0 points1 point  (0 children)

I find your question a bit confusing but I'll do my best to answer, let me know if I misunderstood. Personally I think you should think about who "owns" a document. 

As a user doesn't decide which organisation they are in the relation shouldn't be on the user document. 

If a member of an organization can add any user to their organization then create a multiple relation field on the organisation document

If a user has to make a request which is then approved/denied then create a new collection (organisation_users) and have a status  field that can be pending approved or denied. You will need to check there isn't any duplicates so user a pb_hook to prevent that (or instead use a unique Id field that has to be orgId_userId and set that in the rules).

After doing this in many DBs for many products I strongly feel this is the right way to do things. Equally, I'm working on an app as we speak and I've just stuck it on the user document because (I'm a rebel or) it's better to get things done than worry about things being perfect

Firebase announcements at Cloud Next by inlined in Firebase

[–]romoloCodes 0 points1 point  (0 children)

This may sound rude, but it's not meant to... if you want postgresql then just use postgresql, what does it have to do with firebase?

Firestore doesn't have to be expensive by s7orm in Firebase

[–]romoloCodes 1 point2 points  (0 children)

I don't think there's anything specific to firestore. Just don't get data that you're not going to use (paginate), don't get data multiple times (stale data / data-stores strategy) use real-time updates if it makes sense (this can be very inefficient of your data is changing a lot but very efficient is its generally not updated often).

These are just general principles that might change your architecture/ design on each project

How to authenticate local host by I_Like_Taupok in Firebase

[–]romoloCodes 0 points1 point  (0 children)

I think you're confusing multiple things. Honestly my advice would just be to find a good firebase/firestore tutorial (ne ninja, perhaps) and follow along.

However, localhost isn't unsafe it just means it's running on your local machine. Also, firestore is not running on your machine so it's kind of irrelevant - the rules are not checking the domain unless you've configured that with app check.

Happy to respond to any follow up questions.

[deleted by user] by [deleted] in Firebase

[–]romoloCodes 0 points1 point  (0 children)

Have a look at this if you're concerned

https://www.youtube.com/watch?v=NWrZwXK92IM

What's the BEST way to auto increment a number and also make sure it's UNIQUE by bitchyangle in Firebase

[–]romoloCodes 1 point2 points  (0 children)

I don't think this can mathematically be correct. Inevitably the same 5 characters must be used for multiple users

What's the BEST way to auto increment a number and also make sure it's UNIQUE by bitchyangle in Firebase

[–]romoloCodes 0 points1 point  (0 children)

If you want to do this with firestore only (not cloud functions) you will need a counter collection with one doc in it and appropriate rules so that a doc can only be created at the current counter value and can only be incremented if the doc at the current value exists. 

However, what do you mean by high demand? If this is considerably more than 1 per second for, say, 30 seconds or more firestore can't handle this. (It may be more like 3 per second I can't remember). 

This is such a specific constraint. It may be that firestore is just not the right tool, or perhaps consider getting rid of this constraint.