Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Realtime instance can not be configured using params for onValueWritten functions #1613

Open
pitazzo opened this issue Sep 11, 2024 · 1 comment

Comments

@pitazzo
Copy link

pitazzo commented Sep 11, 2024

Version info

node: v20.10.0

firebase-functions: ^5.1.1

firebase-tools: 13.16.0

firebase-admin: ^12.4.0

Test case

Setup a Firebase Cloud Function with the following code:

exports.foo = onValueWritten(
  {
    ref: '/foo/bar,
    instance: defineString('REALTIME_INSTANCE'),
  },
  async (change) => {
    console.log('hey!);
  },
);

Steps to reproduce

Try to compile following the example code, npm run build.

Expected behavior

We should be able to deploy functions with Realtime instance as a parameter. This is very needed in projects with different Realtime instance per environment. For example, we have to different Realtime instances, one for production and another for staging, and we want to have our functions deployed twice, once per instance.

Actual behavior

As the ReferenceOptions<Ref> object only accepts string as type for the instance value, it's impossible to configure it based on the environment.

Were you able to successfully deploy your functions?

No, as it's impossible to build the codebase.

@google-oss-bot
Copy link
Collaborator

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants