fix issue where auth emulator had invalid type for metadata.creation_time and metadata.last_sign_in_time#9810
fix issue where auth emulator had invalid type for metadata.creation_time and metadata.last_sign_in_time#9810
metadata.creation_time and metadata.last_sign_in_time#9810Conversation
Summary of ChangesHello @aalej, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical data type mismatch in the Firebase Auth Emulator. Previously, user metadata timestamps ( Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request effectively addresses the issue where metadata.creation_time and metadata.last_sign_in_time were incorrectly formatted as strings instead of numbers in the Auth emulator's JWT payload. The changes correctly update the BlockingFunctionsJwtPayload type definition and ensure that these timestamp fields are parsed to numbers before being included in the JWT. The corresponding test assertions have also been updated to reflect this change, ensuring the emulator's behavior aligns with the expectations of firebase-functions and firebase-admin.
Description
Fixes #8109.
It seems like the expected type for
user_record.metadata.creation_timeanduser_record.metadata.last_sign_in_timeisnumber, since if they are sent to the functions emulator as astring, they can't be parsed https://github.com/firebase/firebase-functions/blob/5f7b331abd5a2a38a4e84de1e51411ea5919c0c3/src/common/providers/identity.ts#L554-L564code below will result in
Invalid Datebut numbers will work
Seems like both
firebase-functionsandfirebase-adminexpectcreation_timeandlast_sign_in_timeto be numbersScenarios Tested
See https://github.com/aalej/issues-8109_PR for a repro
Using the mcve:
{ "providerData": [ { "uid": "foo@bar.com", "email": "foo@bar.com", "providerId": "password" } ], "providerId": "password", "isNewUser": false, "metadata": { "creationTime": "Mon, 26 Jan 2026 17:15:21 GMT", "lastSignInTime": "Mon, 26 Jan 2026 17:15:21 GMT" } }matched with prod console logs

Sample Commands