Resolving Conflicts
Today I focused on reflecting the main updates from the upstream repository into my version. The targets were three high-priority remaining UX items from ADR 0004 Wave H phase (#285, #289, #290), but during the cherry-picking process, minor conflicts and type errors were quite intricately entangled, so I resolved them one by one.
Porting Updates and Resolving Cherry-pick Conflicts
The features to be ported were thread-specific compaction queue processing, improving streaming reportback reliability between flash and PTC, and globally sharing scroll position and sidebar folder state between ChatViews.
Of course, conflicts occurred during the cherry-picking process. Core files like MarketChatPanel.tsx, api.test.ts, AuthContext.tsx, ChatView.tsx came in, but fortunately, the conflicts themselves followed a pattern where new code that didn't exist on our side was being added, so we could resolve them relatively smoothly by adopting the incoming changes.
Resolving Cherry-pick Contamination and Adding Missing Code
The real problem was that the cherry-pick, while performing automatic merging, also pulled in code from other upstream commits that didn't exist in our fork. This caused errors as it was referencing non-existent functions or modules.
First, the clearFlashWorkspaceCache function, which clears workspace cache on logout, was missing, so I created a new flashWorkspace.ts file to cache and initialize it in module scope. This serves as a safeguard to prevent the previous user's workspace ID from being inherited when another user logs in again in the same browser tab.
Additionally, I confirmed that tests were breaking due to the absence of the streamWorkspaceEvents function, which parses SSE streams to pass state values, so I implemented and added it myself. I also expanded the parameter interface to fill in the missing chartSelections parameter that the compaction queue was referencing during destructuring.
Fighting with TypeScript Type Errors
Local tests (vitest) passed easily, but during the tsc --noEmit step executed during CI builds, a total of 6 type errors poured out.
I cleaned up unused, unimplemented oauthPopup module imports, declared the missing warmingState type in the ChatViewProps interface, and explicitly imported several functions and utilities that the shared link handler was referencing. I also defined chartSelections, used in compaction, in the ModelOptions interface and expanded the parameter count of the meta helper function to fix compilation errors one by one.
For reference, for the ChartSelectionSnapshot type, which depends on the #276/#281(chart selection feature) module that hasn't been ported yet, I temporarily bypassed it by handling it as a placeholder in the form of Record<string, unknown> to safely pass the tsc check.
Today's Results and Lessons
Finally, I confirmed that everything passed cleanly with 0 errors, from the tsc check to all backend tests (pytest 4,056 cases) and frontend tests (vitest 1,390 cases). I cleanly committed the changes and created PR #11 on the feat/wave-h-285-289-290 branch.
Through this work, I learned that when cherry-picking, I need to more carefully check what dependencies the previous upstream commits have using git show. I also painfully realized that I shouldn't just trust local test passes and need to develop the habit of running tsc --noEmit locally before pushing to CI to firmly nail down the types.
Today's Thoughts
As the differences between the original source and my modified source grew, I spent considerable time merging some features.
Although I was handling some by cherry-picking, a situation arose where one feature I wanted to bring in required a large-scale merge operation, and it seems I'll be spending several days just on merging.