From 41005be07e95d720859a3ae43758f1037e977f7a Mon Sep 17 00:00:00 2001 From: mehm8128 Date: Sat, 22 Jun 2024 01:21:00 +0900 Subject: [PATCH] =?UTF-8?q?limit=E3=81=A8offset=E3=82=92=E6=9A=AB=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=81=A4=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/mockServiceWorker.js | 28 +++++++++----------------- src/features/transaction/repository.ts | 2 ++ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js index 3c94cff7..24fe3a25 100644 --- a/public/mockServiceWorker.js +++ b/public/mockServiceWorker.js @@ -2,13 +2,14 @@ /* tslint:disable */ /** - * Mock Service Worker (2.0.5). + * Mock Service Worker. * @see https://github.com/mswjs/msw * - Please do NOT modify this file. * - Please do NOT serve this file on production. */ -const INTEGRITY_CHECKSUM = '0877fcdc026242810f5bfde0d7178db4' +const PACKAGE_VERSION = '2.3.1' +const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() @@ -48,7 +49,10 @@ self.addEventListener('message', async function (event) { case 'INTEGRITY_CHECK_REQUEST': { sendToClient(client, { type: 'INTEGRITY_CHECK_RESPONSE', - payload: INTEGRITY_CHECKSUM, + payload: { + packageVersion: PACKAGE_VERSION, + checksum: INTEGRITY_CHECKSUM, + }, }) break } @@ -121,11 +125,6 @@ async function handleRequest(event, requestId) { if (client && activeClientIds.has(client.id)) { ;(async function () { const responseClone = response.clone() - // When performing original requests, response body will - // always be a ReadableStream, even for 204 responses. - // But when creating a new Response instance on the client, - // the body for a 204 response must be null. - const responseBody = response.status === 204 ? null : responseClone.body sendToClient( client, @@ -137,11 +136,11 @@ async function handleRequest(event, requestId) { type: responseClone.type, status: responseClone.status, statusText: responseClone.statusText, - body: responseBody, + body: responseClone.body, headers: Object.fromEntries(responseClone.headers.entries()), }, }, - [responseBody], + [responseClone.body], ) })() } @@ -207,13 +206,6 @@ async function getResponse(event, client, requestId) { return passthrough() } - // Bypass requests with the explicit bypass header. - // Such requests can be issued by "ctx.fetch()". - const mswIntention = request.headers.get('x-msw-intention') - if (['bypass', 'passthrough'].includes(mswIntention)) { - return passthrough() - } - // Notify the client that a request has been intercepted. const requestBuffer = await request.arrayBuffer() const clientMessage = await sendToClient( @@ -245,7 +237,7 @@ async function getResponse(event, client, requestId) { return respondWithMock(clientMessage.data) } - case 'MOCK_NOT_FOUND': { + case 'PASSTHROUGH': { return passthrough() } } diff --git a/src/features/transaction/repository.ts b/src/features/transaction/repository.ts index 4a1e9b5d..59a26ce8 100644 --- a/src/features/transaction/repository.ts +++ b/src/features/transaction/repository.ts @@ -29,6 +29,8 @@ const createTransactionRepository = () => ({ querySeed.target, querySeed.since, querySeed.until, + 100, + 0, querySeed.tags.join(','), querySeed.group, querySeed.request