Skip to content

fix(types): allow optional error parameter in CallbackSession - #364

Closed
hoanle0126 wants to merge 1 commit into
fastify:mainfrom
hoanle0126:fix/callback-session-optional-err-158
Closed

hoanle0126 wants to merge 1 commit into
fastify:mainfrom
hoanle0126:fix/callback-session-optional-err-158

Conversation

@hoanle0126

Copy link
Copy Markdown

Checklist

Description

Fixes #158

Marks err as optional in CallbackSession (type CallbackSession = (err?: any, result?: Fastify.Session | null) => void, matching Callback) so custom SessionStore.get implementations can invoke callback() without arguments when a session is not found, as well as callback(null), callback(null, null), callback(error), and callback(null, sessionData).

Adds type tests in types/index.tst.ts covering custom SessionStore callback invocations.

@hoanle0126 hoanle0126 closed this by deleting the head repository Nov 6, 2026
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.

Type definition of callback arguments for SessionStore.get

1 participant