Skip to content

Calling login() again crashes #1403

@BirjuVachhani

Description

@BirjuVachhani

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

  • Output of flutter doctor
  • Version of purchases-flutter
  • Testing device version e.g.: iOS 15.5, Android API 30, etc.
  • How often the issue occurs- every one of your customers is impacted? Only in dev?
  • Debug logs that reproduce the issue
  • Steps to reproduce, with a description of expected vs. actual behavior
    Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Describe the bug

Cannot call login() again with a different custom app user ID. I use firebase auth for my app. When the user logs out from the app, I am not calling logout() on Purchases.When the user tries to log in with a different account, I call Purchases.login() with the new app user ID. It is throwing this error:

DEBUG( 7258): 👤 Logging in from wLuCs5qxdRcN1UJhFIsF4ef0xC02 -> oacB3yH6dnV8bq0C0v1tGwTbfO63
D/[Purchases] - DEBUG( 7258): ℹ️ No subscriber attributes to synchronize.
E/[Purchases] - ERROR( 7258): Enqueuing operation in closed dispatcher

After throwing the error, it is stuck. Nothing works. I have to kill the app and open it again.

Additional context

I am following strict Custom App user ID guidelines from the docs to avoid creating annonymous IDs.

I am on latest Flutter stable release: 3.32.6
purchases_flutter package version: 8.10.6

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions