fix: implement chronological deduplication for branched conversations#58
fix: implement chronological deduplication for branched conversations#58ryoppippi merged 5 commits intoryoppippi:mainfrom ben-vargas:fix/19-remove-duplicates-by-date
Conversation
- Add deduplication logic that respects chronological order to fix issue #19 - Sort JSONL files by earliest timestamp before processing - Track processed message+request ID combinations to skip duplicates - Ensure original entries are kept and later duplicates are discarded - Add comprehensive test suite for deduplication functionality This prevents double-counting of tokens and costs when conversations are branched, which creates duplicate entries with identical message and request IDs. Files are now processed oldest-first to ensure costs are attributed to the correct date.
WalkthroughDeduplication and chronological ordering have been added to the data loading logic. New functions generate unique hashes for messages using message and request IDs, sort files by their earliest timestamp, and filter out duplicate entries. The test suite verifies these behaviors, ensuring only unique messages are counted and processed in order. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DataLoader
participant FileSystem
Client->>DataLoader: loadDailyUsageData/loadSessionData()
DataLoader->>FileSystem: List JSONL files
DataLoader->>FileSystem: Read each file for earliest timestamp
DataLoader->>DataLoader: sortFilesByTimestamp(files)
loop For each file in chronological order
DataLoader->>FileSystem: Read file line by line
loop For each line
DataLoader->>DataLoader: createUniqueHash(message.id + requestId)
alt Hash not seen
DataLoader->>DataLoader: Process entry, add hash to seen set
else Hash seen
DataLoader->>DataLoader: Skip duplicate entry
end
end
end
DataLoader->>Client: Return deduplicated, chronologically processed data
Assessment against linked issues
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @ben-vargas, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses an issue where branching conversations in Claude Code led to inflated token counts and incorrect cost attribution due to duplicate usage entries. The changes introduce a robust system that processes usage data files chronologically and deduplicates entries based on unique message and request identifiers, ensuring accurate reporting of usage and costs.
Highlights
- Chronological File Processing: Implemented logic to read JSONL usage files in chronological order based on the earliest timestamp found within each file. This ensures that the original usage entry is processed before any potential duplicates created by branching.
- Message-Level Deduplication: Introduced a deduplication mechanism that identifies unique API calls using a combination of
message.idandrequestId. ASetis used to track processed entries, skipping any subsequent occurrences of the same message+request ID combination. - Integration into Data Loading: Applied the new chronological sorting and deduplication logic to both
loadDailyUsageDataandloadSessionDatafunctions, ensuring accurate token counts and cost calculations across different views. - Comprehensive Testing: Added a new test suite (
data-loader-deduplication.test.ts) specifically for the deduplication and sorting functionality, covering various scenarios including missing IDs, invalid JSON, and files without timestamps.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configureGemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces a robust solution for deduplicating usage data in branched conversations by implementing chronological file processing and message-level deduplication. The changes are well-reasoned, and the addition of a comprehensive test suite is excellent. The core logic for sorting files by timestamp and then using a hash of message.id and requestId to skip duplicates appears correct and effectively addresses the described problem.
My review includes a suggestion for structuring tests to improve maintainability and a minor point on error handling for consideration.
| let tempDir: string; | ||
|
|
||
| it('should extract earliest timestamp from JSONL file', async () => { | ||
| tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-')); | ||
| const testFile = path.join(tempDir, 'test.jsonl'); | ||
|
|
||
| const content = [ | ||
| JSON.stringify({ timestamp: '2025-01-15T12:00:00Z', message: { usage: {} } }), | ||
| JSON.stringify({ timestamp: '2025-01-10T10:00:00Z', message: { usage: {} } }), | ||
| JSON.stringify({ timestamp: '2025-01-12T11:00:00Z', message: { usage: {} } }), | ||
| ].join('\n'); | ||
|
|
||
| await writeFile(testFile, content); | ||
|
|
||
| const timestamp = await getEarliestTimestamp(testFile); | ||
| expect(timestamp).toEqual(new Date('2025-01-10T10:00:00Z')); | ||
|
|
||
| await rm(tempDir, { recursive: true }); | ||
| }); | ||
|
|
||
| it('should handle files without timestamps', async () => { | ||
| tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-')); | ||
| const testFile = path.join(tempDir, 'test.jsonl'); | ||
|
|
||
| const content = [ | ||
| JSON.stringify({ message: { usage: {} } }), | ||
| JSON.stringify({ data: 'no timestamp' }), | ||
| ].join('\n'); | ||
|
|
||
| await writeFile(testFile, content); | ||
|
|
||
| const timestamp = await getEarliestTimestamp(testFile); | ||
| expect(timestamp).toBeNull(); | ||
|
|
||
| await rm(tempDir, { recursive: true }); | ||
| }); | ||
|
|
||
| it('should skip invalid JSON lines', async () => { | ||
| tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-')); | ||
| const testFile = path.join(tempDir, 'test.jsonl'); | ||
|
|
||
| const content = [ | ||
| 'invalid json', | ||
| JSON.stringify({ timestamp: '2025-01-10T10:00:00Z', message: { usage: {} } }), | ||
| '{ broken: json', | ||
| ].join('\n'); | ||
|
|
||
| await writeFile(testFile, content); | ||
|
|
||
| const timestamp = await getEarliestTimestamp(testFile); | ||
| expect(timestamp).toEqual(new Date('2025-01-10T10:00:00Z')); | ||
|
|
||
| await rm(tempDir, { recursive: true }); | ||
| }); |
There was a problem hiding this comment.
The setup and teardown of tempDir is repeated in each test within the describe('getEarliestTimestamp') block (and similarly in describe('sortFilesByTimestamp')). While this works, using beforeEach and afterEach (or beforeAll/afterAll if appropriate) can make the tests cleaner and reduce boilerplate, ensuring consistent setup/teardown logic.
For example:
describe('getEarliestTimestamp', () => {
let tempDir: string;
beforeEach(async () => {
tempDir = await mkdtemp(path.join(tmpdir(), 'ccusage-test-'));
});
afterEach(async () => {
if (tempDir) {
// Adding force: true can be useful for cleanup, especially in CI environments
await rm(tempDir, { recursive: true, force: true });
}
});
it('should extract earliest timestamp from JSONL file', async () => {
const testFile = path.join(tempDir, 'test.jsonl');
// ... rest of the test, no need to call mkdtemp or rm here
});
// ... other tests in this describe block
});This pattern helps centralize the temporary directory management for the test suite.
src/data-loader.ts
Outdated
| catch { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
The broad catch { return null; } for the entire getEarliestTimestamp function is functional for the current use case, as it ensures files that can't be processed (due to read errors or being empty/all-invalid) are effectively ignored or sorted to the end.
However, for improved diagnostics, you might consider logging an error if readFile itself fails (e.g., due to permissions or file not found), as this is a different class of issue than a file simply not containing valid timestamps. This could be done by catching specific errors or by logging within this catch block before returning null.
For example:
catch (error) {
console.error(`Error processing file ${filePath}:`, error);
return null;
}This is optional and depends on the desired level of verbosity for file processing errors. The current behavior of returning null is acceptable for the sorting logic.
catch (error) {
// Optional: Log the error for diagnostics if desired.
// console.error(`Failed to get earliest timestamp for ${filePath}:`, error);
return null;
}There was a problem hiding this comment.
Improved as recommended - commit c8d206b
- Import logger for diagnostic messages - Log file access errors at debug level in getEarliestTimestamp() - Helps distinguish between file access issues vs files without timestamps - Maintains existing behavior while improving diagnostics
- Add beforeEach/afterEach hooks for tempDir management - Remove duplicate mkdtemp and rm calls from individual tests - Add force: true to rm for more reliable cleanup - Makes test code DRYer and ensures consistent cleanup
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/data-loader.ts (2)
108-118: Consider using a proper hashing algorithm for more robust deduplication.The current implementation using simple concatenation works but could have edge cases if IDs contain colons. As mentioned in the PR objectives, using a proper hashing algorithm would be more robust.
+import { createHash } from 'node:crypto'; export function createUniqueHash(data: UsageData): string | null { const messageId = data.message.id; const requestId = data.requestId; if (messageId == null || requestId == null) { return null; } - // Create a hash using simple concatenation - return `${messageId}:${requestId}`; + // Create a hash using SHA-256 for collision resistance + return createHash('sha256') + .update(`${messageId}:${requestId}`) + .digest('hex'); }🧰 Tools
🪛 ESLint
[error] 109-109: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 109-109: Unsafe member access .message on an
errortyped value.(ts/no-unsafe-member-access)
[error] 110-110: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 110-110: Unsafe member access .requestId on an
errortyped value.(ts/no-unsafe-member-access)
147-150: Remove unnecessary continue statement.The
continuestatement in the catch block is redundant since it's the last statement in the loop iteration.catch { // Skip invalid JSON lines - continue; }🧰 Tools
🪛 Biome (1.9.4)
[error] 149-149: Unnecessary continue statement
Unsafe fix: Delete the unnecessary continue statement
(lint/correctness/noUnnecessaryContinue)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/data-loader-deduplication.test.ts(1 hunks)src/data-loader.ts(8 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/data-loader-deduplication.test.ts (1)
src/data-loader.ts (5)
createUniqueHash(108-118)getEarliestTimestamp(124-161)sortFilesByTimestamp(167-191)loadDailyUsageData(238-419)loadSessionData(421-640)
src/data-loader.ts (2)
src/logger.ts (1)
logger(5-5)src/pricing-fetcher.ts (1)
PricingFetcher(16-165)
🪛 ESLint
src/data-loader-deduplication.test.ts
[error] 13-13: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 14-14: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 15-15: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 29-29: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 29-29: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 29-29: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 32-32: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 45-45: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 45-45: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 45-45: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 48-48: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 61-61: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 61-61: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 61-61: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 65-65: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 68-68: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 69-69: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 69-69: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 69-69: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 69-69: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 69-69: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 72-72: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 74-74: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 78-78: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 79-79: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 79-79: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 79-79: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 87-87: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 89-89: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 90-90: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 90-90: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 90-90: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 93-93: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 94-94: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 94-94: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 94-94: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 101-101: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 103-103: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 104-104: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 104-104: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 104-104: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 107-107: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 108-108: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 108-108: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 108-108: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 116-116: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 118-118: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 119-119: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 119-119: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 119-119: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 123-123: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 126-126: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-127: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 127-127: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-127: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-127: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 127-127: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 130-130: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 132-132: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 136-136: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 137-137: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 137-137: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 137-137: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 138-138: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 138-138: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 138-138: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 139-139: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 139-139: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 139-139: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 142-142: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 145-145: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 148-148: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 150-150: Unsafe argument of type any[] assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 152-152: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 152-152: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 152-152: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 155-155: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 156-156: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 156-156: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 156-156: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 157-157: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 157-157: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 157-157: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 158-158: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 158-158: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 158-158: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 160-160: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 161-161: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 162-162: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 164-164: Unsafe argument of type any[] assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 166-166: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 166-166: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 166-166: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 170-170: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 173-173: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 174-174: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 174-174: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 174-174: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 174-174: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 174-174: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 175-175: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 175-175: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 175-175: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 176-176: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 176-176: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 176-176: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 177-177: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 177-177: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 177-177: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 179-179: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 180-180: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 180-180: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 180-180: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 194-194: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 195-195: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 195-195: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 195-195: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 214-214: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 214-214: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 214-214: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 215-215: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 215-215: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 215-215: Unsafe member access .date on an error typed value.
(ts/no-unsafe-member-access)
[error] 215-215: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 216-216: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 216-216: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 216-216: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 216-216: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 217-217: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 217-217: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 217-217: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 217-217: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 219-219: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 222-222: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 223-223: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 223-223: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 223-223: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 223-223: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 223-223: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 224-224: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 224-224: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 224-224: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 227-227: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 227-227: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 227-227: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 228-228: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 228-228: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 228-228: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 231-231: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 232-232: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 246-246: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 265-265: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 265-265: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 265-265: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 266-266: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 266-266: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 266-266: Unsafe member access .date on an error typed value.
(ts/no-unsafe-member-access)
[error] 266-266: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 267-267: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 267-267: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 267-267: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 267-267: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 268-268: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 268-268: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 268-268: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 268-268: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 270-270: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 274-274: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 277-277: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 278-278: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 278-278: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 278-278: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 278-278: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 278-278: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 279-279: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 279-279: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 279-279: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 280-280: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 280-280: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 280-280: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 281-281: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 281-281: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 281-281: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 283-283: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 284-284: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 284-284: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 284-284: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 298-298: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 299-299: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 299-299: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 299-299: Unsafe member access .join on an error typed value.
(ts/no-unsafe-member-access)
[error] 318-318: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 318-318: Unsafe member access .sessionId on an error typed value.
(ts/no-unsafe-member-access)
[error] 319-319: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 319-319: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 319-319: Unsafe member access .toBeDefined on an error typed value.
(ts/no-unsafe-member-access)
[error] 320-320: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 320-320: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 320-320: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 320-320: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 321-321: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 321-321: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 321-321: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 321-321: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 324-324: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 324-324: Unsafe member access .sessionId on an error typed value.
(ts/no-unsafe-member-access)
[error] 326-326: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 326-326: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 326-326: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 326-326: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 327-327: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 327-327: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 327-327: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 327-327: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 331-331: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 331-331: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 331-331: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 334-334: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
src/data-loader.ts
[error] 30-30: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 30-30: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 30-30: Unsafe member access .optional on an error typed value.
(ts/no-unsafe-member-access)
[error] 30-30: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 30-30: Unsafe member access .string on an error typed value.
(ts/no-unsafe-member-access)
[error] 32-32: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 32-32: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 32-32: Unsafe member access .optional on an error typed value.
(ts/no-unsafe-member-access)
[error] 32-32: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 32-32: Unsafe member access .number on an error typed value.
(ts/no-unsafe-member-access)
[error] 33-33: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 33-33: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 33-33: Unsafe member access .optional on an error typed value.
(ts/no-unsafe-member-access)
[error] 33-33: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 33-33: Unsafe member access .string on an error typed value.
(ts/no-unsafe-member-access)
[error] 109-109: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 109-109: Unsafe member access .message on an error typed value.
(ts/no-unsafe-member-access)
[error] 110-110: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 110-110: Unsafe member access .requestId on an error typed value.
(ts/no-unsafe-member-access)
[error] 126-126: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 126-126: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-127: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 127-127: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-127: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-127: Unsafe member access .trim on an error typed value.
(ts/no-unsafe-member-access)
[error] 127-127: Unsafe member access .split on an error typed value.
(ts/no-unsafe-member-access)
[error] 132-132: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 132-132: Unsafe member access .trim on an error typed value.
(ts/no-unsafe-member-access)
[error] 137-137: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 158-158: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 158-158: Unsafe member access .debug on an error typed value.
(ts/no-unsafe-member-access)
[error] 253-253: Unsafe argument of type error typed assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 256-256: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 436-436: Unsafe argument of type error typed assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 439-439: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
🪛 Biome (1.9.4)
src/data-loader.ts
[error] 149-149: Unnecessary continue statement
Unsafe fix: Delete the unnecessary continue statement
(lint/correctness/noUnnecessaryContinue)
🔇 Additional comments (6)
src/data-loader-deduplication.test.ts (1)
1-337: Comprehensive test coverage for deduplication functionality!The test suite thoroughly covers all the new deduplication features including hash creation, timestamp extraction, file sorting, and deduplication in data loading. Good use of
beforeEach/afterEachfor test setup/cleanup as recommended in previous reviews.🧰 Tools
🪛 ESLint
[error] 13-13: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 14-14: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 15-15: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 29-29: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 29-29: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 29-29: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 32-32: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 45-45: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 45-45: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 45-45: Unsafe member access .toBeNull on an
errortyped value.(ts/no-unsafe-member-access)
[error] 48-48: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 61-61: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 61-61: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 61-61: Unsafe member access .toBeNull on an
errortyped value.(ts/no-unsafe-member-access)
[error] 65-65: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 68-68: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 69-69: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 69-69: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 69-69: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 69-69: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 69-69: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 72-72: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 74-74: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 78-78: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 79-79: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 79-79: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 79-79: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 87-87: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 89-89: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 90-90: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 90-90: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 90-90: Unsafe member access .toEqual on an
errortyped value.(ts/no-unsafe-member-access)
[error] 93-93: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 94-94: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 94-94: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 94-94: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 101-101: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 103-103: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 104-104: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 104-104: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 104-104: Unsafe member access .toBeNull on an
errortyped value.(ts/no-unsafe-member-access)
[error] 107-107: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 108-108: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 108-108: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 108-108: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 116-116: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 118-118: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 119-119: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 119-119: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 119-119: Unsafe member access .toEqual on an
errortyped value.(ts/no-unsafe-member-access)
[error] 123-123: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 126-126: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 127-127: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 127-127: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 127-127: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 127-127: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 127-127: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 130-130: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 132-132: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 136-136: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 137-137: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 137-137: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 137-137: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 138-138: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 138-138: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 138-138: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 139-139: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 139-139: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 139-139: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 142-142: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 145-145: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 148-148: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 150-150: Unsafe argument of type
any[]assigned to a parameter of typestring[].(ts/no-unsafe-argument)
[error] 152-152: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 152-152: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 152-152: Unsafe member access .toEqual on an
errortyped value.(ts/no-unsafe-member-access)
[error] 155-155: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 156-156: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 156-156: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 156-156: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 157-157: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 157-157: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 157-157: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 158-158: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 158-158: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 158-158: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 160-160: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 161-161: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 162-162: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 164-164: Unsafe argument of type
any[]assigned to a parameter of typestring[].(ts/no-unsafe-argument)
[error] 166-166: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 166-166: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 166-166: Unsafe member access .toEqual on an
errortyped value.(ts/no-unsafe-member-access)
[error] 170-170: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 173-173: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 174-174: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 174-174: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 174-174: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 174-174: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 174-174: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 175-175: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 175-175: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 175-175: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 176-176: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 176-176: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 176-176: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 177-177: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 177-177: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 177-177: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 179-179: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 180-180: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 180-180: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 180-180: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 194-194: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 195-195: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 195-195: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 195-195: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 214-214: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 214-214: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 214-214: Unsafe member access .toHaveLength on an
errortyped value.(ts/no-unsafe-member-access)
[error] 215-215: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 215-215: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 215-215: Unsafe member access .date on an
errortyped value.(ts/no-unsafe-member-access)
[error] 215-215: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 216-216: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 216-216: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 216-216: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 216-216: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 217-217: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 217-217: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 217-217: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 217-217: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 219-219: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 222-222: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 223-223: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 223-223: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 223-223: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 223-223: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 223-223: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 224-224: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 224-224: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 224-224: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 227-227: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 227-227: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 227-227: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 228-228: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 228-228: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 228-228: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 231-231: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 232-232: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 246-246: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 265-265: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 265-265: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 265-265: Unsafe member access .toHaveLength on an
errortyped value.(ts/no-unsafe-member-access)
[error] 266-266: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 266-266: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 266-266: Unsafe member access .date on an
errortyped value.(ts/no-unsafe-member-access)
[error] 266-266: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 267-267: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 267-267: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 267-267: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 267-267: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 268-268: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 268-268: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 268-268: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 268-268: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 270-270: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 274-274: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 277-277: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 278-278: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 278-278: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 278-278: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 278-278: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 278-278: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 279-279: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 279-279: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 279-279: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 280-280: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 280-280: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 280-280: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 281-281: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 281-281: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 281-281: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 283-283: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 284-284: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 284-284: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 284-284: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 298-298: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 299-299: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 299-299: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 299-299: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 318-318: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 318-318: Unsafe member access .sessionId on an
errortyped value.(ts/no-unsafe-member-access)
[error] 319-319: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 319-319: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 319-319: Unsafe member access .toBeDefined on an
errortyped value.(ts/no-unsafe-member-access)
[error] 320-320: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 320-320: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 320-320: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 320-320: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 321-321: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 321-321: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 321-321: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 321-321: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 324-324: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 324-324: Unsafe member access .sessionId on an
errortyped value.(ts/no-unsafe-member-access)
[error] 326-326: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 326-326: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 326-326: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 326-326: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 327-327: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 327-327: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 327-327: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 327-327: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 331-331: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 331-331: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 331-331: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 334-334: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
src/data-loader.ts (5)
30-33: Schema changes support deduplication while maintaining backward compatibility.The addition of optional
idandrequestIdfields enables unique identification of messages for deduplication without breaking existing data structures.🧰 Tools
🪛 ESLint
[error] 30-30: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 30-30: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 30-30: Unsafe member access .optional on an
errortyped value.(ts/no-unsafe-member-access)
[error] 30-30: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 30-30: Unsafe member access .string on an
errortyped value.(ts/no-unsafe-member-access)
[error] 32-32: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 32-32: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 32-32: Unsafe member access .optional on an
errortyped value.(ts/no-unsafe-member-access)
[error] 32-32: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 32-32: Unsafe member access .number on an
errortyped value.(ts/no-unsafe-member-access)
[error] 33-33: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 33-33: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 33-33: Unsafe member access .optional on an
errortyped value.(ts/no-unsafe-member-access)
[error] 33-33: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 33-33: Unsafe member access .string on an
errortyped value.(ts/no-unsafe-member-access)
167-191: Efficient chronological file sorting with proper null handling.Good use of
Promise.allfor concurrent timestamp extraction and clear sorting logic that ensures files without timestamps don't interfere with chronological processing.
252-293: Deduplication implementation correctly prevents double-counting of branched conversations.The chronological file processing combined with hash-based deduplication ensures that original entries are preserved while duplicates from branched conversations are filtered out. This effectively solves the inflated token count issue.
🧰 Tools
🪛 ESLint
[error] 253-253: Unsafe argument of type error typed assigned to a parameter of type
string[].(ts/no-unsafe-argument)
[error] 256-256: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 268-268: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 268-268: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 269-272: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 269-272: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 269-271: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 269-270: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 270-270: Unsafe member access .trim on an
errortyped value.(ts/no-unsafe-member-access)
[error] 271-271: Unsafe member access .split on an
errortyped value.(ts/no-unsafe-member-access)
[error] 272-272: Unsafe member access .filter on an
errortyped value.(ts/no-unsafe-member-access)
[error] 272-272: Unsafe member access .length on an
anyvalue.(ts/no-unsafe-member-access)
[error] 276-276: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 277-277: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 277-277: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 277-277: Unsafe member access .safeParse on an
errortyped value.(ts/no-unsafe-member-access)
[error] 278-278: Unexpected any value in conditional. An explicit comparison or type conversion is required.
(ts/strict-boolean-expressions)
[error] 278-278: Unsafe member access .success on an
errortyped value.(ts/no-unsafe-member-access)
[error] 281-281: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 281-281: Unsafe member access .output on an
errortyped value.(ts/no-unsafe-member-access)
435-494: Consistent deduplication pattern ensures session data accuracy.The implementation mirrors the approach used in
loadDailyUsageData, maintaining consistency across the codebase and ensuring session-level data is also protected from duplication issues.🧰 Tools
🪛 ESLint
[error] 436-436: Unsafe argument of type error typed assigned to a parameter of type
string[].(ts/no-unsafe-argument)
[error] 439-439: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 460-460: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 460-460: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 460-460: Unsafe member access .relative on an
errortyped value.(ts/no-unsafe-member-access)
[error] 461-461: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 461-461: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 461-461: Unsafe member access .split on an
errortyped value.(ts/no-unsafe-member-access)
[error] 461-461: Unsafe member access .sep on an
errortyped value.(ts/no-unsafe-member-access)
[error] 464-464: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 464-464: Unsafe member access [parts.length - 2] on an
errortyped value.(ts/no-unsafe-member-access)
[error] 464-464: Unsafe member access .length on an
errortyped value.(ts/no-unsafe-member-access)
[error] 466-466: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 466-466: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 466-466: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 466-466: Unsafe member access .slice on an
errortyped value.(ts/no-unsafe-member-access)
[error] 466-466: Unsafe member access .join on an
errortyped value.(ts/no-unsafe-member-access)
[error] 466-466: Unsafe member access .sep on an
errortyped value.(ts/no-unsafe-member-access)
[error] 467-467: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 467-467: Unsafe member access .length on an
errortyped value.(ts/no-unsafe-member-access)
[error] 469-469: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 469-469: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 470-473: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 470-473: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 470-472: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 470-471: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 471-471: Unsafe member access .trim on an
errortyped value.(ts/no-unsafe-member-access)
[error] 472-472: Unsafe member access .split on an
errortyped value.(ts/no-unsafe-member-access)
[error] 473-473: Unsafe member access .filter on an
errortyped value.(ts/no-unsafe-member-access)
[error] 473-473: Unsafe member access .length on an
anyvalue.(ts/no-unsafe-member-access)
[error] 477-477: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 478-478: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 478-478: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 478-478: Unsafe member access .safeParse on an
errortyped value.(ts/no-unsafe-member-access)
[error] 479-479: Unexpected any value in conditional. An explicit comparison or type conversion is required.
(ts/strict-boolean-expressions)
[error] 479-479: Unsafe member access .success on an
errortyped value.(ts/no-unsafe-member-access)
[error] 482-482: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 482-482: Unsafe member access .output on an
errortyped value.(ts/no-unsafe-member-access)
9-9: Good use of debug logging for diagnostics.The logger import and debug message in
getEarliestTimestampprovide helpful diagnostics without cluttering normal output, following the pattern established in previous reviews.Also applies to: 158-158
commit: |
|
Thank you for implementing |
| describe('getEarliestTimestamp', () => { | ||
| let tempDir: string; | ||
|
|
There was a problem hiding this comment.
please use fs-fixture for mocking files
There was a problem hiding this comment.
oh refer how to use fs-fixture in other test file. you can use await using syntax
instead of using afterEach beforeEach
Replace manual temporary directory creation with fs-fixture for cleaner and more maintainable test setup. This change addresses PR review feedback from @ryoppippi. Changes: - Remove manual filesystem imports (mkdir, mkdtemp, rm, writeFile) - Use createFixture from fs-fixture package - Simplify test setup/teardown with fixture lifecycle methods - Improve readability with declarative directory structure creation
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/data-loader-deduplication.test.ts (4)
1-9: Prefer extension-less relative import for first-party modules
./data-loader.tsworks when the runner understands.tsextensions, but omitting the extension ('./data-loader') is more portable across Node, Bun & Jest setups and avoids redundant file-path churn during emits.-import { - createUniqueHash, - // … -} from './data-loader.ts'; +import { + createUniqueHash, + // … +} from './data-loader';
74-84: Terminate the generated JSONL string with a newlineSome JSONL readers rely on a trailing newline to treat the last line as a full record.
Appending\nmakes the fixture closer to real files and guards against edge-case regressions.-].join('\n'); +].join('\n') + '\n';🧰 Tools
🪛 ESLint
[error] 74-74: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 81-81: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 81-81: Unsafe member access .writeFile on an
errortyped value.(ts/no-unsafe-member-access)
[error] 83-83: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 83-83: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 83-83: Unsafe member access .getPath on an
errortyped value.(ts/no-unsafe-member-access)
[error] 84-84: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 84-84: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 84-84: Unsafe member access .toEqual on an
errortyped value.(ts/no-unsafe-member-access)
167-213: Also assert monetary cost to fully exercise deduplicationThe test currently validates token counts but ignores the
costUSDfield, even though cost inflation was a key issue (#19).
Adding a simple expectation ensures the deduplication logic updates every derived metric.expect(data[0]?.outputTokens).toBe(50); +expect(data[0]?.costUSD).toBe(0.001);🧰 Tools
🪛 ESLint
[error] 167-167: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 168-201: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 168-168: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 204-204: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 204-204: Unsafe member access .path on an
errortyped value.(ts/no-unsafe-member-access)
[error] 209-209: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 209-209: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 209-209: Unsafe member access .toHaveLength on an
errortyped value.(ts/no-unsafe-member-access)
[error] 210-210: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 210-210: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 210-210: Unsafe member access .date on an
errortyped value.(ts/no-unsafe-member-access)
[error] 210-210: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 211-211: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 211-211: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 211-211: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 211-211: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 212-212: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 212-212: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 212-212: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 212-212: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
315-323: Avoid branching expectations; assert the single expected outcomeThe conditional makes the test pass in two different scenarios, reducing its diagnostic value.
Since the deduplication should drop the newer duplicate entirely, assert the authoritative path:-const session2 = sessions.find(s => s.sessionId === 'session2'); -expect(session2).toBeUndefined(); -expect(sessions).toHaveLength(1); +expect(sessions.find(s => s.sessionId === 'session2')).toBeUndefined(); +expect(sessions).toHaveLength(1);This keeps the test focused and ensures regressions are caught early.
🧰 Tools
🪛 ESLint
[error] 315-315: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 315-315: Unsafe member access .sessionId on an
errortyped value.(ts/no-unsafe-member-access)
[error] 317-317: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 317-317: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 317-317: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 317-317: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 318-318: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 318-318: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 318-318: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 318-318: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 322-322: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 322-322: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 322-322: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/data-loader-deduplication.test.ts(1 hunks)
🧰 Additional context used
🪛 ESLint
src/data-loader-deduplication.test.ts
[error] 11-11: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 12-12: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 13-13: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 27-27: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 27-27: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 27-27: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 30-30: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 43-43: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 43-43: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 43-43: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 46-46: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 59-59: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 59-59: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 59-59: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 63-63: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 66-66: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 67-67: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 67-67: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 70-70: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 71-71: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 71-71: Unsafe member access .rm on an error typed value.
(ts/no-unsafe-member-access)
[error] 74-74: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 81-81: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 81-81: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 83-83: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 83-83: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 83-83: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 84-84: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 84-84: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 84-84: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 87-87: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 93-93: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 93-93: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 95-95: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 95-95: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 95-95: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 96-96: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 96-96: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 96-96: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 99-99: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 106-106: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 106-106: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 108-108: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 108-108: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 108-108: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 109-109: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 109-109: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 109-109: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 113-113: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 116-116: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 117-117: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 117-117: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 120-120: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 121-121: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 121-121: Unsafe member access .rm on an error typed value.
(ts/no-unsafe-member-access)
[error] 124-124: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 126-126: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 126-126: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 129-129: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 129-129: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 132-132: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 132-132: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 134-134: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 134-134: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 134-134: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 135-135: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 135-135: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 135-135: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 136-136: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 136-136: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 136-136: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 138-138: Unsafe argument of type any[] assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 140-140: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 140-140: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 140-140: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 143-143: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 144-144: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 144-144: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 145-145: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 145-145: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 146-146: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 146-146: Unsafe member access .writeFile on an error typed value.
(ts/no-unsafe-member-access)
[error] 148-148: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 148-148: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 148-148: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 149-149: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 149-149: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 149-149: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 150-150: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 150-150: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 150-150: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 152-152: Unsafe argument of type any[] assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 154-154: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 154-154: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 154-154: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 158-158: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 161-161: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 163-163: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 163-163: Unsafe member access .rm on an error typed value.
(ts/no-unsafe-member-access)
[error] 167-167: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 168-201: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 168-168: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 204-204: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 204-204: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 209-209: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 209-209: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 209-209: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 210-210: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 210-210: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 210-210: Unsafe member access .date on an error typed value.
(ts/no-unsafe-member-access)
[error] 210-210: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 211-211: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 211-211: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 211-211: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 211-211: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 212-212: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 212-212: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 212-212: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 212-212: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 215-215: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 216-243: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 216-216: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 246-246: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 246-246: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 251-251: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 251-251: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 251-251: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 252-252: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 252-252: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 252-252: Unsafe member access .date on an error typed value.
(ts/no-unsafe-member-access)
[error] 252-252: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 253-253: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 253-253: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 253-253: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 253-253: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 254-254: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 254-254: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 254-254: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 254-254: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 258-258: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 261-261: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 263-263: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 263-263: Unsafe member access .rm on an error typed value.
(ts/no-unsafe-member-access)
[error] 267-267: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 268-301: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 268-268: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 304-304: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 304-304: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 309-309: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 309-309: Unsafe member access .sessionId on an error typed value.
(ts/no-unsafe-member-access)
[error] 310-310: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 310-310: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 310-310: Unsafe member access .toBeDefined on an error typed value.
(ts/no-unsafe-member-access)
[error] 311-311: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 311-311: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 311-311: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 311-311: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 312-312: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 312-312: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 312-312: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 312-312: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 315-315: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 315-315: Unsafe member access .sessionId on an error typed value.
(ts/no-unsafe-member-access)
[error] 317-317: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 317-317: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 317-317: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 317-317: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 318-318: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 318-318: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 318-318: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 318-318: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 322-322: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 322-322: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 322-322: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
Replace beforeEach/afterEach hooks with 'await using' syntax for fs-fixture cleanup as requested in PR review. This follows the pattern used in other test files and leverages TypeScript's explicit resource management feature. Changes: - Remove beforeEach/afterEach hooks - Use 'await using fixture = await createFixture()' syntax - Automatic cleanup when leaving scope - Each test is now more self-contained
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
src/data-loader-deduplication.test.ts (1)
1-1:⚠️ Potential issueSilence the
@typescript-eslint/no-unsafe-*noiseAll Bun /
fs-fixturehelpers returnany, so every assertion is currently triggering dozens of no-unsafe violations in CI.
Add the one-liner ESLint directive suggested in the previous review so the pipeline can run clean again.+/* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument */ import { describe, expect, it } from 'bun:test';
🧹 Nitpick comments (3)
src/data-loader-deduplication.test.ts (3)
64-77: Make timestamp assertion timezone-agnostic
expect(dateObj).toEqual(new Date('…'))relies on Bun’s deep-equality Date handling and can fail on exotic runtimes or ifDateis stringified differently.
Comparing the ISO string is bullet-proof and keeps intent crystal-clear.-const timestamp = await getEarliestTimestamp(fixture.getPath('test.jsonl')); -expect(timestamp).toEqual(new Date('2025-01-10T10:00:00Z')); +const timestamp = await getEarliestTimestamp(fixture.getPath('test.jsonl')); +expect(timestamp?.toISOString()).toBe('2025-01-10T10:00:00.000Z');🧰 Tools
🪛 ESLint
[error] 64-64: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 71-73: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 71-71: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 75-75: Unsafe argument of type error typed assigned to a parameter of type
string.(ts/no-unsafe-argument)
[error] 75-75: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 75-75: Unsafe member access .getPath on an
errortyped value.(ts/no-unsafe-member-access)
[error] 76-76: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 76-76: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 76-76: Unsafe member access .toEqual on an
errortyped value.(ts/no-unsafe-member-access)
283-292: Tighten expectations for duplicated sessionsAllowing either “session2 absent” or “present with 0 tokens” weakens the guarantee that no empty sessions leak through.
Prefer asserting that the duplicate session is not returned at all:-const session2 = sessions.find(s => s.sessionId === 'session2'); -if (session2 != null) { - expect(session2.inputTokens).toBe(0); - expect(session2.outputTokens).toBe(0); -} -else { - expect(sessions.length).toBe(1); -} +expect(sessions.some(s => s.sessionId === 'session2')).toBe(false);This makes the contract unambiguous and prevents accidental emission of empty session objects.
🧰 Tools
🪛 ESLint
[error] 284-284: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 284-284: Unsafe member access .sessionId on an
errortyped value.(ts/no-unsafe-member-access)
[error] 286-286: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 286-286: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 286-286: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 286-286: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 287-287: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 287-287: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 287-287: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 287-287: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 291-291: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 291-291: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 291-291: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
145-178: Minor DRY opportunityThe JSON blobs for duplicate messages are repeated verbatim several times.
Extracting aconst duplicateEntry = …at the top of thedescribeblock (or using a helper) would trim ~40 lines and make future tweaks easier. Not a blocker.🧰 Tools
🪛 ESLint
[error] 145-178: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 145-145: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/data-loader-deduplication.test.ts(1 hunks)
🧰 Additional context used
🪛 ESLint
src/data-loader-deduplication.test.ts
[error] 11-11: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 12-12: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 13-13: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 27-27: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 27-27: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 27-27: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 30-30: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 43-43: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 43-43: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 43-43: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 46-46: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 59-59: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 59-59: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 59-59: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 63-63: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 64-64: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 71-73: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 71-71: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 75-75: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 75-75: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 75-75: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 76-76: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 76-76: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 76-76: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 79-79: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 85-87: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 85-85: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 89-89: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 89-89: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 89-89: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 90-90: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 90-90: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 90-90: Unsafe member access .toBeNull on an error typed value.
(ts/no-unsafe-member-access)
[error] 93-93: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 100-102: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 100-100: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 104-104: Unsafe argument of type error typed assigned to a parameter of type string.
(ts/no-unsafe-argument)
[error] 104-104: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 104-104: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 105-105: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 105-105: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 105-105: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 109-109: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 110-110: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 111-115: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 111-111: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 117-117: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 117-117: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 117-117: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 118-118: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 118-118: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 118-118: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 119-119: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 119-119: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 119-119: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 121-121: Unsafe argument of type any[] assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 123-123: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 123-123: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 123-123: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 126-126: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 127-131: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 127-127: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 133-133: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 133-133: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 133-133: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 134-134: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 134-134: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 134-134: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 135-135: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 135-135: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 135-135: Unsafe member access .getPath on an error typed value.
(ts/no-unsafe-member-access)
[error] 137-137: Unsafe argument of type any[] assigned to a parameter of type string[].
(ts/no-unsafe-argument)
[error] 139-139: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 139-139: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 139-139: Unsafe member access .toEqual on an error typed value.
(ts/no-unsafe-member-access)
[error] 143-143: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 144-144: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 145-178: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 145-145: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 181-181: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 181-181: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 186-186: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 186-186: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 186-186: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 187-187: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 187-187: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 187-187: Unsafe member access .date on an error typed value.
(ts/no-unsafe-member-access)
[error] 187-187: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 188-188: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 188-188: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 188-188: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 188-188: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 189-189: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 189-189: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 189-189: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 189-189: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 192-192: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 193-220: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 193-193: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 223-223: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 223-223: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 228-228: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 228-228: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 228-228: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 229-229: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 229-229: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 229-229: Unsafe member access .date on an error typed value.
(ts/no-unsafe-member-access)
[error] 229-229: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 230-230: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 230-230: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 230-230: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 230-230: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 231-231: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 231-231: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 231-231: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 231-231: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 235-235: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 236-236: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 237-270: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 237-237: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 273-273: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 273-273: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 278-278: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 278-278: Unsafe member access .sessionId on an error typed value.
(ts/no-unsafe-member-access)
[error] 279-279: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 279-279: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 279-279: Unsafe member access .toBeDefined on an error typed value.
(ts/no-unsafe-member-access)
[error] 280-280: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 280-280: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 280-280: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 280-280: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 281-281: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 281-281: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 281-281: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 281-281: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 284-284: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 284-284: Unsafe member access .sessionId on an error typed value.
(ts/no-unsafe-member-access)
[error] 286-286: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 286-286: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 286-286: Unsafe member access .inputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 286-286: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 287-287: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 287-287: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 287-287: Unsafe member access .outputTokens on an error typed value.
(ts/no-unsafe-member-access)
[error] 287-287: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 291-291: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 291-291: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 291-291: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
🔇 Additional comments (1)
src/data-loader-deduplication.test.ts (1)
192-232: Verify the simplified test directory layoutThis test places the JSONL files directly under
projects/, skipping the usual<project>/<session>/…depth used elsewhere.
IfloadDailyUsageDatarelies on that structure, the test could produce a false-positive (it would silently read zero files and still “pass”).Please confirm that
loadDailyUsageDataperforms a recursive search independent of path depth, or add an explicit session folder here to mirror real data.🧰 Tools
🪛 ESLint
[error] 192-192: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 193-220: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 193-193: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 223-223: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 223-223: Unsafe member access .path on an
errortyped value.(ts/no-unsafe-member-access)
[error] 228-228: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 228-228: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 228-228: Unsafe member access .toHaveLength on an
errortyped value.(ts/no-unsafe-member-access)
[error] 229-229: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 229-229: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 229-229: Unsafe member access .date on an
errortyped value.(ts/no-unsafe-member-access)
[error] 229-229: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 230-230: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 230-230: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 230-230: Unsafe member access .inputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 230-230: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
[error] 231-231: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 231-231: Unsafe call of a(n)
errortype typed value.(ts/no-unsafe-call)
[error] 231-231: Unsafe member access .outputTokens on an
errortyped value.(ts/no-unsafe-member-access)
[error] 231-231: Unsafe member access .toBe on an
errortyped value.(ts/no-unsafe-member-access)
|
Thanks |
fix: implement chronological deduplication for branched conversations


Fix: Implement Chronological Deduplication for Branched Conversations
Summary
This PR fixes issue #19 by implementing a chronologically-aware deduplication system that prevents double-counting of tokens and costs when conversations are branched in Claude Code.
Fixes #19
Problem
When users branch conversations in Claude Code (by editing a past message with Esc+Esc), the application creates a new conversation that includes duplicate entries from the original conversation. These duplicates have identical
requestIdandmessage.idvalues, causing:Root Cause
The current implementation processes JSONL files in an undefined order (filesystem-dependent). This means:
Solution
This PR implements a comprehensive deduplication solution that:
1. Chronological File Processing
getEarliestTimestamp()to extract the earliest timestamp from each JSONL filesortFilesByTimestamp()to sort files by their earliest timestamp2. Message Deduplication
UsageDataSchemato includemessage.idandrequestIdfieldscreateUniqueHash()to generate unique identifiers from message+request IDsloadDailyUsageData()andloadSessionData()3. Robust Implementation
Testing
Added comprehensive test suite (
data-loader-deduplication.test.ts) with 11 tests covering:All existing tests (117 total) continue to pass.
Code Changes
Modified Files:
src/data-loader.ts- Added deduplication logic and chronological processingsrc/data-loader-deduplication.test.ts- New comprehensive test suiteKey Functions Added:
Impact
Verification
Before this fix:
After this fix:
Breaking Changes
None. This change is backward compatible and transparent to users.
Future Considerations
This implementation uses a simple concatenation for the hash (
messageId:requestId). If needed, this could be upgraded to use a proper hashing algorithm, though the current approach is sufficient for the use case.Summary by CodeRabbit