Skip to content

Commit

Permalink
fix: upgrade dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mingchuno committed Mar 14, 2023
1 parent 8ad92d0 commit d52dc41
Show file tree
Hide file tree
Showing 4 changed files with 1,591 additions and 1,474 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Upgrade dependency

## [5.0.0] - 2023-03-14

### **BREAKING CHANGES**
Expand Down
4 changes: 2 additions & 2 deletions src/lib/MongoStore.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ test.serial('touch ops with touchAfter', async (t) => {
const session = await collection.findOne({ _id: sid })
const lastModifiedBeforeTouch = session?.lastModified?.getTime()
t.not(session, undefined)
await storePromise.touch(sid, (session as unknown) as SessionData)
await storePromise.touch(sid, session as unknown as SessionData)
const session2 = await collection.findOne({ _id: sid })
t.not(session2, undefined)
const lastModifiedAfterTouch = session2?.lastModified?.getTime()
Expand All @@ -288,7 +288,7 @@ test.serial('touch ops with touchAfter with touch', async (t) => {
const lastModifiedBeforeTouch = session?.lastModified?.getTime()
await new Promise((resolve) => setTimeout(resolve, 1200))
t.not(session, undefined)
await storePromise.touch(sid, (session as unknown) as SessionData)
await storePromise.touch(sid, session as unknown as SessionData)
const session2 = await collection.findOne({ _id: sid })
t.not(session2, undefined)
const lastModifiedAfterTouch = session2?.lastModified?.getTime()
Expand Down
8 changes: 3 additions & 5 deletions src/lib/MongoStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export default class MongoStore extends session.Store {
})
if (this.crypto && session) {
await this.decryptSession(
(session as unknown) as session.SessionData
session as unknown as session.SessionData
).catch((err) => callback(err))
}
const s =
Expand Down Expand Up @@ -377,7 +377,7 @@ export default class MongoStore extends session.Store {
).catch((err) => {
throw new Error(err)
})
s.session = (data as unknown) as session.SessionData
s.session = data as unknown as session.SessionData
}
const collection = await this.collectionP
const rawResp = await collection.updateOne(
Expand Down Expand Up @@ -480,9 +480,7 @@ export default class MongoStore extends session.Store {
const results: session.SessionData[] = []
for await (const session of sessions) {
if (this.crypto && session) {
await this.decryptSession(
(session as unknown) as session.SessionData
)
await this.decryptSession(session as unknown as session.SessionData)
}
results.push(this.transformFunctions.unserialize(session.session))
}
Expand Down
Loading

0 comments on commit d52dc41

Please sign in to comment.