Skip to content

ref!: Remove flushAsync option - #2409

Merged
Luca Forstner (lforst) merged 2 commits into
v4from
lforst/dum-e/florence-0cc173acda
Aug 31, 2026
Merged

Luca Forstner (lforst) merged 2 commits into
v4from
lforst/dum-e/florence-0cc173acda

Conversation

@lforst

@lforst Luca Forstner (lforst) commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Ref braintrustdata/braintrust-sdk-javascript#1841

flushAsync grinded my gears a bit a) as a user b) as a maintainer. Why?:

  • As a user, it added a quite intransparent API that is hard to wrap your head around.
  • As a user, it added a generic type to otherwise very non-generic APIs that made the LSP types incredibly hard to navigate
  • As a maintainer, it required a generic type to be passed around to literally everywhere
  • As a maintainer, it required us to have a weird flushAsync option to every tracing API

In reality, what you can do instead, and which is very simple to understand, is simply do await flush() or await logger.flush() right after a span is ended. Not hard, very few if no drawbacks.

@lforst Luca Forstner (lforst) mentioned this pull request Aug 28, 2026
14 of 16 tasks
@lforst
Luca Forstner (lforst) changed the base branch from main to v4 August 28, 2026 15:03
@lforst
Luca Forstner (lforst) changed the base branch from v4 to main August 28, 2026 15:04
@lforst
Luca Forstner (lforst) force-pushed the lforst/dum-e/florence-0cc173acda branch from 15d91a5 to 11736b4 Compare August 28, 2026 15:58
@lforst
Luca Forstner (lforst) changed the base branch from main to v4 August 28, 2026 15:59
@lforst Luca Forstner (lforst) changed the title ref!: Remove flushAsync option everywhere ref!: Remove flushAsync option Aug 31, 2026
@lforst
Luca Forstner (lforst) merged commit 34bff9d into v4 Aug 31, 2026
90 of 92 checks passed
@lforst
Luca Forstner (lforst) deleted the lforst/dum-e/florence-0cc173acda branch August 31, 2026 18:05
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.

2 participants