Skip to content

Latest commit

 

History

History
496 lines (282 loc) · 8.82 KB

File metadata and controls

496 lines (282 loc) · 8.82 KB

Problem Tracker

📋 Table of Contents



🆔 20 - Sliding window token logic planning


Status: ⏳ Pending

Language: Typescript

Time Taken: 10m

🐞 Problem Description

Drafted getMessageWindow(windowLimit) algorithm: sum tokens, reset at summaries, return token‑bounded slice




🆔 19 - Docs platform choice: MkDocs vs Docusaurus


Status: ⏳ Pending

Language: Markdown

Time Taken: 8m

🐞 Problem Description

Evaluated MkDocs (Python/Jinja) vs Docusaurus (React) for JS project docs; lean toward Docusaurus for JS injection




🆔 18 - tsconfig include/exclude path issues bug


Status: ✅ Solved

Language: Typescript

Time Taken: 5m

🐞 Problem Description

No inputs found until tsconfig.json include/exclude corrected

'include': ['src/**/*'],'exclude': ['dist']

✅ Solution Description


Adjust include paths to match src folder
tsconfig.json include: ['src/**/*']



🆔 17 - Use rimraf for clean script


Status: ✅ Solved

Language: Shell

Time Taken: 3m

🐞 Problem Description

Added 'rimraf dist' in clean script to remove compiled files cross‑platform




🆔 16 - npm pack & npm publish workflow


Status: ✅ Solved

Language: Shell

Time Taken: 5m

🐞 Problem Description

Practiced npm login, npm pack to preview tarball, and npm publish --access public for initial versions




🆔 15 - ISC vs MIT license basics


Status: ✅ Solved

Language: Text

Time Taken: 6m

🐞 Problem Description

Learned ISC is a permissive license similar to MIT; you can’t retroactively restrict MIT‑licensed code




🆔 14 - package.json keywords for npm search


Status: ✅ Solved

Language: Json

Time Taken: 3m

🐞 Problem Description

Learned the 'keywords' field helps npm registry searchability and should list relevant tags

'keywords': ['ai','context']



🆔 13 - Jest config file extension matters bug


Status: ✅ Solved

Language: Javascript

Time Taken: 4m

🐞 Problem Description

Tests failed until jest.config.js was renamed to jest.config.mjs to match module type

module.exports = {...}

✅ Solution Description


Rename file and update test command
jest --config jest.config.mjs



🆔 12 - TSImplicitAny on parameters


Status: ✅ Solved

Language: Typescript

Time Taken: 6m

🐞 Problem Description

Disabled noImplicitAny in tsconfig or added explicit types to function parameters to avoid TS7006 errors




🆔 11 - ESLint & TS config missing modules


Status: ✅ Solved

Language: Javascript

Time Taken: 7m

🐞 Problem Description

Fixed eslint.config.mjs imports by installing @eslint/js, globals, and typescript-eslint plugins to resolve 'module not found'

import js from "@eslint/js";
import globals from "globals";



🆔 10 - Typo in editMessage event name bug


Status: ✅ Solved

Language: Typescript

Time Taken: 5m

🐞 Problem Description

Emitted 'messageEditted' instead of 'messageEdited', listeners never fired

this.emit('messageEditted',...)

✅ Solution Description


Corrected event name to 'messageEdited'
this.emit("messageEdited", id, newMsg);



🆔 9 - clone() missed copying messages bug


Status: ✅ Solved

Language: Typescript

Time Taken: 7m

🐞 Problem Description

clone() only copied metadata; new session was empty

clone(id,name){return new ConversationSession(...)}

✅ Solution Description


Iterate original.messages and set on cloned.messages
for (const [i, m] of this.messages) clone.messages.set(i, { ...m });



🆔 8 - clearMessages didn’t clear buffer bug


Status: ✅ Solved

Language: Typescript

Time Taken: 6m

🐞 Problem Description

clearMessages() stub left messages intact, causing tests to fail

clearMessages():void{this.messages.clear()}

✅ Solution Description


Implement this.messages.clear() and emit event
clearMessages(){this.messages.clear();this.emit('messagesCleared',this.id)}



🆔 7 - Array.from works on Map iterators


Status: ✅ Solved

Language: Typescript

Time Taken: 4m

🐞 Problem Description

Realized Array.from(map.values()) returns Message[]; Array.from(map.entries()) returns [id, Message] tuples

Array.from(this.messages.values());



🆔 6 - Partial makes all fields optional


Status: ✅ Solved

Language: Typescript

Time Taken: 4m

🐞 Problem Description

Used Partial to stub incomplete Message objects in tests without requiring all fields

const stub: Partial<Message> = { role, content };



🆔 5 - Suppress unused‑vars via underscore or ESLint disable


Status: ✅ Solved

Language: Typescript

Time Taken: 5m

🐞 Problem Description

Learned to prefix unused parameters with _ or use eslint-disable-next-line to silence no-unused-vars

// eslint-disable-next-line @typescript-eslint/no-unused-vars



🆔 4 - Rename replaceMessage→editMessage for clarity


Status: ✅ Solved

Language: Typescript

Time Taken: 3m

🐞 Problem Description

Chose editMessage over replaceMessage to more accurately describe updating an existing message in place

editMessage(id, newMsg);



🆔 3 - messageAdded listener crash when throwing


Status: ✅ Solved

Language: Typescript

Time Taken: 8m

🐞 Problem Description

Found that unhandled errors in EventEmitter listeners crash the process

this.emit("messageAdded", id, message);

✅ Solution Description


Wrapped listener code in try/catch to prevent bubble-up
emitter.on('messageAdded', (id,msg)=>{ try{}catch(e){console.error(e)} });



🆔 2 - Dynamic property assignment in TS


Status: ✅ Solved

Language: Typescript

Time Taken: 4m

🐞 Problem Description

Discovered you can assign new fields (message.id = id) at runtime in JS/TS without errors, but types must include them or be cast

message.id = generatedId;



🆔 1 - TS Map preserves insertion order


Status: ✅ Solved

Language: Typescript

Time Taken: 5m

🐞 Problem Description

Learned that Map<string,Message> maintains insertion order, unlike plain objects, ideal for chat history sequencing

private messages: Map<string, Message> = new Map();