expressjs / expressjs/session

Session Store Implementation doesn't mention that at times `callback` parameter won't be defined

Open
#898 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
6.4k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

- I maintain an express/session store and the other day I got someone's contribution that makes calling the `function destroy`'s callback optional: https://github.com/TimDaub/better-sqlite3-session-store/pull/10
- So I looked into https://github.com/expressjs/session#session-store-implementation because I thought that I must have missed this rather important detail
- But I couldn't find any mention that potentially the callback parameter is omitted in some invocations
- So I continued searching and found that a very popular implementation of expressjs/session adds `noop` as the `cb`'s default value in every function signature: https://github.com/tj/connect-redis/blob/a4770bd07f7a248beb902708b3c1d3914ddb5dc6/lib/connect-redis.js#L12

So, hence, I think the readme's specification should make a mention that `callback` may not always be invocable as a JavaScript function.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.