Repository navigation
fix(reader-access): expired sessions no longer hold a device slot #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
271c6df
fix(reader-access): make session suites pass under Vitest
claude cf9ea7d
docs(changelog): record reader session Vitest fixes
claude 8012713
Merge origin/main: defer to db189ff session-suite fixes
claude 80d77c0
Merge branch 'main' into claude/charming-keller-8en9db
ashleyshaw a5307b8
Merge branch 'main' into claude/charming-keller-8en9db
ashleyshaw b1e648b
Merge branch 'main' into claude/charming-keller-8en9db
ashleyshaw f2c9bd0
Merge branch 'main' into claude/charming-keller-8en9db
ashleyshaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /** | ||
| * In-memory stand-in for `netlify/lib/blobs` in Vitest suites. | ||
| * | ||
| * It mirrors the `@netlify/blobs` behaviour the session layer depends on: | ||
| * `list({ prefix })` filters keys by prefix and resolves to | ||
| * `{ blobs: [{ key, etag }], directories }`, not to a bare array of keys. | ||
| * | ||
| * Usage (vi.mock factories are hoisted, so import the helper inside them): | ||
| * | ||
| * vi.mock('../../netlify/lib/blobs', async () => | ||
| * (await import('../helpers/in-memory-blob-store')).inMemoryBlobsModule() | ||
| * ); | ||
| * | ||
| * Call `resetInMemoryBlobStore()` in `beforeEach` to isolate tests. | ||
| */ | ||
|
|
||
| import type { BlobListResult, BlobStore } from '../../netlify/lib/blobs'; | ||
|
|
||
| const entries = new Map<string, string>(); | ||
|
|
||
| const store: BlobStore = { | ||
| async get(key) { | ||
| return entries.has(key) ? (entries.get(key) as string) : null; | ||
| }, | ||
| async set(key, value) { | ||
| entries.set(key, value); | ||
| }, | ||
| async delete(key) { | ||
| entries.delete(key); | ||
| }, | ||
| async list(options = {}): Promise<BlobListResult> { | ||
| const prefix = options.prefix ?? ''; | ||
| const blobs = Array.from(entries.keys()) | ||
| .filter((key) => key.startsWith(prefix)) | ||
| .map((key) => ({ key, etag: `"${key.length}-${entries.get(key)?.length ?? 0}"` })); | ||
| return { blobs, directories: [] }; | ||
| }, | ||
| }; | ||
|
|
||
| /** Remove every entry from the shared in-memory store. */ | ||
| export function resetInMemoryBlobStore(): void { | ||
| entries.clear(); | ||
| } | ||
|
|
||
| /** Module shape matching `netlify/lib/blobs`, for use as a vi.mock factory result. */ | ||
| export function inMemoryBlobsModule(): { getStore: () => BlobStore } { | ||
| return { getStore: () => store }; | ||
| } |
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shorten the new changelog entry to 250 characters or fewer.
This bullet exceeds the required limit. Keep the reader-visible fix concise. Put the helper and type details in the PR description instead.
As per coding guidelines, “Length: Maximum 250 characters”.
Source: Coding guidelines