-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds RTDB triggers for v2 functions #1127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some overall comments:
- We're missing
src/v2/database.js
which is used to quiet the import linter (since the maintainer of the repo says we should pay them if we want a fix. - We've got an outstanding PR to fix some behavior around null handling in the RTDB. Did we incorporate any of that here? Can we incorporate it without doing a major version bump? We should figure out how to not throw away the author's work
- In general I think
_.isPlainObject
is more strongly verifying things than we need. The only thing we need to check is whether something hastypeof val === 'object'
and that the type is notnull
. - We can ship the current path pattern work for now if we need to, but I strongly suspect we'll want to create a PathPattern utilty class like we have in One Platform code. Maybe PathPattern.compile(string) which can throw if there's a malformed path. Then something like hasParams() and matchParams(atual: string): Record<string, string>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple nits for you Cole, thanks!
I'll take another look when only living code remains.
@rhodgkins Yep that's the one. This will apply both to v1 & v2 functions. |
* Add and handle MockCloudEvents for RTDB-V2 This commit is a follow-up to firebase-function's addition of rtdb-v2, firebase/firebase-functions#1127. Wrap can now handle: * `database.onValueCreated` * `database.onValueDeleted` * `database.onValueUpdated` * `database.onValueWritten`
Adds RTDB triggers for v2 functions.