Skip to content

Commit a4576af

Browse files
renovate[bot]mrstorkpieh
authored
chore(deps): update dependency @netlify/blobs to v10 (#2967)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mateusz Bocian <mrstork@users.noreply.github.com> Co-authored-by: Michal Piechowiak <misiek.piechowiak@gmail.com>
1 parent c3cf553 commit a4576af

File tree

9 files changed

+124
-124
lines changed

9 files changed

+124
-124
lines changed

package-lock.json

Lines changed: 82 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"homepage": "https://opennext.js.org/netlify",
5454
"devDependencies": {
5555
"@fastly/http-compute-js": "1.1.5",
56-
"@netlify/blobs": "^8.2.0",
56+
"@netlify/blobs": "^10.1.0",
5757
"@netlify/build": "^35.1.7",
5858
"@netlify/config": "^24.0.4",
5959
"@netlify/edge-bundler": "^14.5.5",

tests/integration/cache-handler.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('page router', () => {
8282
countOfBlobServerGetsForKey(ctx, '/static/revalidate-automatic'),
8383
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
8484
).toBe(1)
85-
ctx.blobServerGetSpy.mockClear()
85+
ctx.blobServerOnRequestSpy.mockClear()
8686

8787
// wait to have page regenerated in the background
8888
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
@@ -116,7 +116,7 @@ describe('page router', () => {
116116
countOfBlobServerGetsForKey(ctx, '/static/revalidate-automatic'),
117117
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
118118
).toBe(1)
119-
ctx.blobServerGetSpy.mockClear()
119+
ctx.blobServerOnRequestSpy.mockClear()
120120

121121
// ping that should serve the stale page for static/revalidate-slow, while revalidating in background
122122
await invokeFunction(ctx, { url: 'static/revalidate-slow' })
@@ -125,7 +125,7 @@ describe('page router', () => {
125125
countOfBlobServerGetsForKey(ctx, '/static/revalidate-slow'),
126126
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
127127
).toBe(1)
128-
ctx.blobServerGetSpy.mockClear()
128+
ctx.blobServerOnRequestSpy.mockClear()
129129

130130
// wait to have a stale page
131131
await new Promise<void>((resolve) => setTimeout(resolve, 6_000))
@@ -136,7 +136,7 @@ describe('page router', () => {
136136
countOfBlobServerGetsForKey(ctx, '/static/revalidate-slow'),
137137
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
138138
).toBe(1)
139-
ctx.blobServerGetSpy.mockClear()
139+
ctx.blobServerOnRequestSpy.mockClear()
140140

141141
// over 5 seconds since it was regenerated, so we should get stale response,
142142
// while fresh is generated in the background
@@ -160,7 +160,7 @@ describe('page router', () => {
160160
countOfBlobServerGetsForKey(ctx, '/static/revalidate-automatic'),
161161
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
162162
).toBe(1)
163-
ctx.blobServerGetSpy.mockClear()
163+
ctx.blobServerOnRequestSpy.mockClear()
164164

165165
// Slow revalidate should still be a hit, but the maxage should be updated
166166
const callLater2 = await invokeFunction(ctx, { url: 'static/revalidate-slow' })
@@ -177,7 +177,7 @@ describe('page router', () => {
177177
countOfBlobServerGetsForKey(ctx, '/static/revalidate-slow'),
178178
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
179179
).toBe(1)
180-
ctx.blobServerGetSpy.mockClear()
180+
ctx.blobServerOnRequestSpy.mockClear()
181181

182182
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
183183
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
@@ -204,7 +204,7 @@ describe('page router', () => {
204204
countOfBlobServerGetsForKey(ctx, '/static/revalidate-automatic'),
205205
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
206206
).toBe(1)
207-
ctx.blobServerGetSpy.mockClear()
207+
ctx.blobServerOnRequestSpy.mockClear()
208208
})
209209
})
210210

@@ -245,7 +245,7 @@ describe('app router', () => {
245245
countOfBlobServerGetsForKey(ctx, '/posts/1'),
246246
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
247247
).toBe(1)
248-
ctx.blobServerGetSpy.mockClear()
248+
ctx.blobServerOnRequestSpy.mockClear()
249249

250250
// test a prerendered page without TTL
251251
const post2 = await invokeFunction(ctx, { url: '/' })
@@ -263,7 +263,7 @@ describe('app router', () => {
263263
countOfBlobServerGetsForKey(ctx, '/index'),
264264
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
265265
).toBe(1)
266-
ctx.blobServerGetSpy.mockClear()
266+
ctx.blobServerOnRequestSpy.mockClear()
267267

268268
expect(await ctx.blobStore.get(encodeBlobKey('/posts/3'))).toBeNull()
269269
// this page is not pre-rendered and should result in a cache miss
@@ -293,7 +293,7 @@ describe('app router', () => {
293293
countOfBlobServerGetsForKey(ctx, '/posts/1'),
294294
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
295295
).toBe(1)
296-
ctx.blobServerGetSpy.mockClear()
296+
ctx.blobServerOnRequestSpy.mockClear()
297297
// it should've been regenerated in the background after the first call
298298
// so the date should be different
299299
expect(staleDate, 'the date was cached and is matching the initial one').not.toBe(post1Date)
@@ -320,7 +320,7 @@ describe('app router', () => {
320320
countOfBlobServerGetsForKey(ctx, '/posts/1'),
321321
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
322322
).toBe(1)
323-
ctx.blobServerGetSpy.mockClear()
323+
ctx.blobServerOnRequestSpy.mockClear()
324324
})
325325

326326
test<FixtureTestContext>("not-prerendered pages should be permanently cached when produced by sandboxed invocations that don't share memory", async (ctx) => {
@@ -405,7 +405,7 @@ describe('route', () => {
405405
})
406406
expect(blobEntry).not.toBeNull()
407407

408-
ctx.blobServerGetSpy.mockClear()
408+
ctx.blobServerOnRequestSpy.mockClear()
409409

410410
// test the first invocation of the route - we should get stale response while fresh is generated in the background
411411
const call1 = await invokeFunction(ctx, { url: '/api/revalidate-handler' })
@@ -428,7 +428,7 @@ describe('route', () => {
428428
countOfBlobServerGetsForKey(ctx, '/api/revalidate-handler'),
429429
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
430430
).toBe(1)
431-
ctx.blobServerGetSpy.mockClear()
431+
ctx.blobServerOnRequestSpy.mockClear()
432432

433433
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
434434
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
@@ -458,7 +458,7 @@ describe('route', () => {
458458
countOfBlobServerGetsForKey(ctx, '/api/revalidate-handler'),
459459
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
460460
).toBe(1)
461-
ctx.blobServerGetSpy.mockClear()
461+
ctx.blobServerOnRequestSpy.mockClear()
462462

463463
// wait to have a stale route again
464464
await new Promise<void>((resolve) => setTimeout(resolve, 8_000))
@@ -485,7 +485,7 @@ describe('route', () => {
485485
countOfBlobServerGetsForKey(ctx, '/api/revalidate-handler'),
486486
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
487487
).toBe(1)
488-
ctx.blobServerGetSpy.mockClear()
488+
ctx.blobServerOnRequestSpy.mockClear()
489489

490490
// it does not wait for the cache.set so we have to manually wait here until the blob storage got populated
491491
await new Promise<void>((resolve) => setTimeout(resolve, 1000))
@@ -510,7 +510,7 @@ describe('route', () => {
510510
countOfBlobServerGetsForKey(ctx, '/api/revalidate-handler'),
511511
'should only try to get value once from blob store (date calculation should not trigger additional blobs.get)',
512512
).toBe(1)
513-
ctx.blobServerGetSpy.mockClear()
513+
ctx.blobServerOnRequestSpy.mockClear()
514514
})
515515

516516
test<FixtureTestContext>('cacheable route handler response not produced at build is served correctly', async (ctx) => {

tests/integration/fetch-handler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ test<FixtureTestContext>('does not fetch same cached fetch data from blobs twice
363363
'expected blobs for all types of values to be retrieved at most once per key (including fetch data, tag manifests, static files)',
364364
).toBeDistinct()
365365

366-
ctx.blobServerGetSpy.mockClear()
366+
ctx.blobServerOnRequestSpy.mockClear()
367367
handlerCalled = 0
368368
const request2 = await invokeFunction(ctx, {
369369
url: 'same-fetch-multiple-times/99',

tests/integration/request-context.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('request-context does NOT leak between concurrent requests', () => {
106106
lastModified: new Date(mockedDateForRevalidateSlow).getTime(),
107107
})
108108

109-
ctx.blobServerGetSpy.mockClear()
109+
ctx.blobServerOnRequestSpy.mockClear()
110110

111111
const waitForCacheHandlerGetAndPausePromise =
112112
waitForCacheHandlerGetAndPause('/static/revalidate-slow')
@@ -182,7 +182,7 @@ describe('request-context does NOT leak between concurrent requests', () => {
182182
lastModified: new Date(mockedDateForStaticFetch2).getTime(),
183183
})
184184

185-
ctx.blobServerGetSpy.mockClear()
185+
ctx.blobServerOnRequestSpy.mockClear()
186186

187187
const waitForCacheHandlerGetAndPausePromise = waitForCacheHandlerGetAndPause('/static-fetch/2')
188188
const slowCallPromise = invokeFunction(ctx, {

0 commit comments

Comments
 (0)