angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.68k stars 2.19k forks source link

the resource.data is not working to angularfire v9 #3054

Open AdamTeodoro opened 2 years ago

AdamTeodoro commented 2 years ago

The rule that use resource.data is not working to angularfire V9

google-oss-bot commented 2 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

AdamTeodoro commented 2 years ago

they wouldn't solve it even if I had followed the rules for publishing problems kkkkkk, but at least that way I complain and don't waste time typing too much

jamesdaniels commented 2 years ago

@AdamTeodoro are you talking about security rules?

jamesdaniels commented 2 years ago

I understand you're frustrated but please be mindful of the Code of Conduct. We're volunteers here & we have competing demands for our attention.

AdamTeodoro commented 2 years ago

This is not frustrating for me, i 'm sorry the problem is very visible i'm commit for see if devs are update about this problem, without more explications.

Is this one básic use: look my project

the timestamp is not working:

This rule is notworking with angularfirev9: my angular code: my component: https://github.com/AdamTeodoro/AdamTeodoro/tree/master/src/app/components/commit my angualar service: https://github.com/AdamTeodoro/AdamTeodoro/blob/master/src/app/services/commit.service.ts my rule request.time > resource.data.timestamp + duration.value(2, 's');

my angular code: https://github.com/AdamTeodoro/AdamTeodoro/blob/master/src/app/app.component.ts my rule: resource.data.accesses + 1 == request.resource.data.accesses;

AdamTeodoro commented 2 years ago

i'm sorry for my inglish, and thanks for your service and for your patience.

jamesdaniels commented 2 years ago

I'm not sure what you're trying to achieve with that security rule, that 2 seconds must have elapsed from the time that the data was saved? Since you're using server time it strikes me that would be expected to fail. Are you trying to rate limit?

AdamTeodoro commented 2 years ago

yes, the first rule is to limit access, forcing the user to wait seconds to perform a new access. The second rule is to limit the number of increments per access, for each access to increment only once. These rules are working in the previous version.

AdamTeodoro commented 2 years ago

Me desculpe pela demora durante esses quatro dias eu estava dormindo.

AdamTeodoro commented 2 years ago

I'm reading other cases and the problem could be that I'm using set and not update.