Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client already closed exception #256

Open
gh-ranjanKiran opened this issue Mar 20, 2025 · 2 comments
Open

Client already closed exception #256

gh-ranjanKiran opened this issue Mar 20, 2025 · 2 comments

Comments

@gh-ranjanKiran
Copy link

gh-ranjanKiran commented Mar 20, 2025

Image

Hi,
The above exception occurs sometimes during

  1. Hot restart
  2. Multiple times calling disconnectAndClear and reopening connection with new auth token.

We use the same base url for both our

  1. Normal API calls
  2. Connecting to powersync instance

What we have noticed and this is not reproducible is that, sometimes when above issue occurs, our normal API calls also stop working and we receive a response of this type for all API calls until users logs out of the app.

HttpException: Connection closed while receiving data

As we are using Dio library for our API calls, we get this exception type in dio
DioExceptionType.unknown

@michaelbarnes
Copy link

Hey @gh-ranjanKiran Can you please share package versions and other information related to your setup, please?

@gh-ranjanKiran
Copy link
Author

gh-ranjanKiran commented Mar 22, 2025

Hey @gh-ranjanKiran Can you please share package versions and other information related to your setup, please?

Hi @michaelbarnes , we are using these versions

sqlite_async is used for some local only tables. This is also cleared once user logs out

sqlite_async: ^0.11.0
powersync: ^1.11.0
dio: ^5.4.3+1

This is my output for flutter doctor

[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.22621.3296], locale en-IN)
    • Flutter version 3.22.2 on channel stable at 
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (10 months ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at 
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME 
    • Java binary at:
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.5)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.8.34511.84
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[!] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    X Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.3296]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 134.0.6998.118
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 134.0.3124.72

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Also while going through the dio package issues found this somewhat relevant comment
cfug/dio#2170 (comment)

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

No branches or pull requests

2 participants