Skip to content

Fix misc bugs and TS issues#84

Open
kolyasya wants to merge 6 commits into
leonardoventurini:developmentfrom
kolyasya:fix/minimongo-null-docs-and-misc-bugs
Open

Fix misc bugs and TS issues#84
kolyasya wants to merge 6 commits into
leonardoventurini:developmentfrom
kolyasya:fix/minimongo-null-docs-and-misc-bugs

Conversation

@kolyasya
Copy link
Copy Markdown

@kolyasya kolyasya commented May 1, 2026

While working on iframe support and SubsManager compatibility (coming in a separate PR), I needed the extension to actually run cleanly first. These are the bugs I hit along the way.

Fixes

StringUtils.truncate returned a character array instead of a string
[...str.slice(0, max), '...'] spreads the string into individual characters. In template literals this rendered as H,e,l,l,o,.... Fixed to str.slice(0, max) + '...'.

Navigation links opened broken URLs
Same spread bug — openTab([...url, '/issues']) passed an array of characters to browser.tabs.create, so the Issues and Star links silently did nothing. Fixed to string concatenation.

Minimongo tab crashed with Cannot read properties of null (reading '_id')
cleanup() in MinimongoInjector used return inside a for...of loop where continue was needed. On any falsy field value (null, 0, false, ""), the function exited early and returned undefined for an otherwise valid document. Those undefined values reached the React virtualised list renderer, which then crashed trying to read ._id on null. Fixed at three layers: returncontinue in the loop, .filter(Boolean) after cleanup(), and a null guard in the row renderer as a safety net.

FilterConstants TypeScript type inference error
Object.fromEntries(flatMap(...)) return type wasn't inferred correctly, causing a downstream TS error. Added explicit cast.

Content.ts message source check consistency
Minor fix in the content script message handler.

structuredClone not typed (MinimongoInjector)
MinimongoInjector calls structuredClone, which is available at runtime but untyped in the configured TS libs. Added "lib": ["esnext", "dom"] to tsconfig.json for the extension bundle; added an ambient declaration in index.d.ts for the injected page-context script where tsconfig libs don't apply.

kolyasya added 6 commits May 1, 2026 13:56
… context

structuredClone is used in MinimongoInjector but was not typed.
Adding lib: [esnext, dom] to tsconfig covers the extension bundle;
the ambient declaration in index.d.ts covers the injected page script
where tsconfig libs do not apply.

Made-with: Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant