Skip to content

chore: Upgrade compilation target and lib to ES2021#3172

Merged
lahirumaramba merged 1 commit into
mainfrom
lm-es2021
Jun 8, 2026
Merged

chore: Upgrade compilation target and lib to ES2021#3172
lahirumaramba merged 1 commit into
mainfrom
lm-es2021

Conversation

@lahirumaramba

Copy link
Copy Markdown
Member

Upgrade TypeScript compilation target and standard library configurations from es2020 to es2021. It also cleans up a now-redundant runtime workaround for AggregateError in the Messaging module.

@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Jun 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the TypeScript configuration target and library from ES2020 to ES2021, allowing the direct use of AggregateError instead of a workaround. Feedback on the changes suggests using optional chaining when accessing result.reason.message to prevent potential runtime errors if result.reason is null or undefined.

Comment thread src/messaging/messaging.ts Outdated
const cause = new (global as any).AggregateError(allErrors, 'Stream failure and session failures occurred');
const cause = new AggregateError(allErrors, 'Stream failure and session failures occurred');

const streamMessage = result.reason.message || 'Unknown stream error';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To prevent a potential TypeError if result.reason is null or undefined (or not an object), use optional chaining (?.) when accessing the message property. This aligns with defensive programming practices to ensure that unexpected promise rejection values do not cause unhandled runtime exceptions.

Suggested change
const streamMessage = result.reason.message || 'Unknown stream error';
const streamMessage = result.reason?.message || 'Unknown stream error';

@jonathanedey jonathanedey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@lahirumaramba lahirumaramba merged commit 25285ee into main Jun 8, 2026
14 checks passed
@lahirumaramba lahirumaramba deleted the lm-es2021 branch June 8, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants