mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-11 03:06:54 +00:00
chore(stack-files): split accidental code change from docs PR (#1235)
Revert the stack file download metric changes that landed inside the docs introduction squash merge. They can now be reopened as a standalone fix PR with release-please-visible metadata.
This commit is contained in:
@@ -391,9 +391,10 @@ describe('GET /api/stacks/:stackName/files/download', () => {
|
||||
});
|
||||
|
||||
it('records the download metric exactly once per successful response', async () => {
|
||||
// The metric recorder is wired to the file stream lifecycle and guarded
|
||||
// by a flag so a single completion does not double-fire. A regression
|
||||
// that drops the flag would push successCount to 2 for one download.
|
||||
// The metric recorder is wired to both res.on("finish") and
|
||||
// res.on("close"), guarded by a flag so a single completion does not
|
||||
// double-fire. A regression that drops the flag would push successCount
|
||||
// to 2 for one download.
|
||||
const { FileExplorerMetricsService } = await import('../services/FileExplorerMetricsService');
|
||||
FileExplorerMetricsService.resetForTests();
|
||||
|
||||
@@ -403,7 +404,7 @@ describe('GET /api/stacks/:stackName/files/download', () => {
|
||||
.set('Cookie', adminCookie);
|
||||
expect(res.status).toBe(200);
|
||||
|
||||
// Allow the stream lifecycle tail event to fire after the test's await.
|
||||
// Allow the res.on('close') tail event to fire after the test's await.
|
||||
await new Promise<void>((r) => setTimeout(r, 50));
|
||||
|
||||
const metricsRes = await request(app)
|
||||
|
||||
Reference in New Issue
Block a user