Skip to content

ref!: Remove flushAsync option everywhere - #2409

Open
Luca Forstner (lforst) wants to merge 2 commits into
mainfrom
lforst/dum-e/florence-0cc173acda
Open

ref!: Remove flushAsync option everywhere#2409
Luca Forstner (lforst) wants to merge 2 commits into
mainfrom
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
10 tasks
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