Repository navigation
fix(v1): run onInit before task queue and auth blocking handlers - #2003
Open
IzaakGough wants to merge 1 commit into
Open
IzaakGough wants to merge 1 commit into
IzaakGough wants to merge 1 commit into
Conversation
v1 taskQueue().onDispatch and auth.user().beforeCreate, beforeSignIn, beforeEmail and beforeSms built their handler without withInit, so the onInit callback never ran for them. Fixes #2001. relnote: v1 task queue and auth blocking functions now run the onInit callback.
IzaakGough
marked this pull request as ready for review
November 26, 2026 15:51
Contributor
There was a problem hiding this comment.
Code Review
This pull request integrates initialization logic (withInit) into v1 auth blocking functions and task queue handlers, ensuring that any registered onInit callbacks are executed when these functions run. Corresponding unit tests have been added to verify this behavior. Feedback suggests addressing test output pollution caused by multiple onInit registrations across tests, recommending either stubbing logger.warn or introducing a test-only reset helper.
CorieW
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2001.
v1 task queue functions (
tasks.taskQueue().onDispatch) and v1 auth blocking functions (auth.user().beforeCreate,beforeSignIn,beforeEmail,beforeSms) ran their handler without running theonInitcallback first.This runs
onInitbefore these handlers, as other v1 triggers and the v2 equivalents already do.Tested with unit tests, the emulators, and a live deploy.
beforeEmailandbeforeSmsare covered by unit tests only.relnote: v1 task queue and auth blocking functions now run the onInit callback before the handler.