Skip to content

Commit c71c110

Browse files
tsemachhjunie-agent
andcommitted
fix(recorder): unique timestamp-based keys to preserve duplicate API calls
Co-authored-by: Junie <junie@jetbrains.com>
1 parent 9fa7106 commit c71c110

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on Keep a Changelog,
66
and this project adheres to Semantic Versioning.
77

8+
## [1.0.19] - 2026-05-03
9+
### Fixed
10+
- Recording no longer drops duplicate API calls — each recorded entry now gets a unique timestamp-based key so repeated calls to the same endpoint are all preserved.
11+
812
## [1.0.18] - 2026-05-03
913
### Fixed
1014
- Replay no longer logs `Uncaught (in promise) Error: Detached while handling command` when the debugger detaches mid-flight (tab navigated/closed, replay stopped, or service worker recycled). All `chrome.debugger.sendCommand` calls in `src/background/replayer.ts` are now routed through a `safeSendCommand` helper that swallows detach-related errors. After a latency wait, replay state is re-checked before sending the response so we don't try to fulfill on a detached debugger.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apireplay",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"private": true,
55
"type": "module",
66
"scripts": {

src/background/recorder.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import type { StateStore } from './state-store';
33
import { getRecordingByName, upsertRecordingByName } from '../shared/storage';
44
import type { RecordingMetadata } from '../shared/recording';
55

6-
function requestKey(request: { method: string; url: string; status?: number }) {
7-
return `${request.method} ${new URL(request.url).pathname} [${request.status || 200}]`;
6+
function requestKey(request: { method: string; url: string; status?: number; timestamp?: string }) {
7+
const ts = request.timestamp || new Date().toISOString().replace(/[:.]/g, '-');
8+
return `${request.method} ${new URL(request.url).pathname} [${request.status || 200}] ${ts}`;
89
}
910

1011
export async function startRecording(

0 commit comments

Comments
 (0)