Skip to content

fix: remove false warning from enforceAppCheck and consumeAppCheckToken - #1921

Open
IzaakGough wants to merge 8 commits into
masterfrom
@invertase/fix-false-warning-in-enforceAppCheck-and-consumeAppCheckToken
Open

fix: remove false warning from enforceAppCheck and consumeAppCheckToken#1921
IzaakGough wants to merge 8 commits into
masterfrom
@invertase/fix-false-warning-in-enforceAppCheck-and-consumeAppCheckToken

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

This is a follow up-to #1802

@IzaakGough
IzaakGough marked this pull request as ready for review July 7, 2026 16:13
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@IzaakGough

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@IzaakGough

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the onCall function in src/v2/providers/https.ts to use runtimeValue() instead of value() when evaluating Expression instances for enforceAppCheck and consumeAppCheckToken. I have no feedback to provide.

@IzaakGough
IzaakGough requested a review from a team July 23, 2026 13:29
@cabljac
cabljac self-requested a review July 23, 2026 16:08
@inlined

inlined commented Jul 27, 2026

Copy link
Copy Markdown
Member

This code doesn't look necessary. Can you explain what the warning is, why it's wrong, and what this is fixing? This is inside a closure that doesn't run at global scope, so .value() should be OK.

@IzaakGough

Copy link
Copy Markdown
Contributor Author

Hi @inlined, Here's my understanding, let me know if I'm off. onCall() itself runs once, right when the functions file loads, not inside the per-request handler. So when the CLI deploys, it loads the file in a separate process to build the manifest, and sets FUNCTIONS_CONTROL_API=true for that. Since .value() runs during that load, it sees the flag and logs the warning, even though nothing's wrong.

Afaik the warning's meant for fields like memory that stay as unresolved expressions in the manifest. But enforceAppCheck/consumeAppCheckToken need a real boolean baked in at load time, switching to .runtimeValue() gets that without the warning, same reasoning as the cors fix in #1802.

Happy to dig into this more if I'm missing something or there is another way to approach this.

@inlined

inlined commented Jul 28, 2026

Copy link
Copy Markdown
Member

Oh yeah, you're right. the onCall was called not its closure. I would maybe recommend instead making the common implmenetaiton accept a parameter or literal and then using valOf(maybeExpr) inside that code?

@IzaakGough

Copy link
Copy Markdown
Contributor Author

Yeah this is a much nicer way of fixing this issue. I've made those changes, let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants