Skip to content

[Bugfix] Do not allow the user method to change its return types over its lifecycle#567

Merged
silesky merged 1 commit intomasterfrom
bugfix/fix-incorrect-return-values-for-sync-methods
Aug 4, 2022
Merged

[Bugfix] Do not allow the user method to change its return types over its lifecycle#567
silesky merged 1 commit intomasterfrom
bugfix/fix-incorrect-return-values-for-sync-methods

Conversation

@silesky
Copy link
Copy Markdown
Contributor

@silesky silesky commented Aug 4, 2022

I discovered a bug in the recently added "user" method for analytics buffered. It's the only method that's both synchronous and non-chained, so the bug didn't reveal itself previously.

Do not allow the "user" method to change its return types over its lifecycle. We should always return a promise for wrapped methods in AnalyticsBrowser, regardless if the underlying Analytics method is sync or async.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 4, 2022

🦋 Changeset detected

Latest commit: 1b9a40c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@segment/analytics-next Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@chrisradek chrisradek left a comment

Choose a reason for hiding this comment

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

:shipit:

@silesky silesky force-pushed the bugfix/fix-incorrect-return-values-for-sync-methods branch from 1b08191 to 1b9a40c Compare August 4, 2022 21:15
@silesky silesky enabled auto-merge (squash) August 4, 2022 21:15
@silesky silesky merged commit 5cd9358 into master Aug 4, 2022
@silesky silesky deleted the bugfix/fix-incorrect-return-values-for-sync-methods branch August 4, 2022 21:20
@github-actions github-actions bot mentioned this pull request Aug 4, 2022
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