Skip to content

fix: Lock socket_io_client version to 3.1.2 to fix breaking compiler …#507

Open
Mahdijamebozorg wants to merge 2 commits into
cogwheel0:mainfrom
Mahdijamebozorg:main
Open

fix: Lock socket_io_client version to 3.1.2 to fix breaking compiler …#507
Mahdijamebozorg wants to merge 2 commits into
cogwheel0:mainfrom
Mahdijamebozorg:main

Conversation

@Mahdijamebozorg

@Mahdijamebozorg Mahdijamebozorg commented Jun 13, 2026

Copy link
Copy Markdown

Description

This PR hard-locks the socket_io_client dependency to exactly version 3.1.2 by removing the caret (^) prefix in pubspec.yaml.

The Problem

We were previously using socket_io_client: ^3.1.2. Due to the caret notation, flutter pub get was silently pulling the latest minor patch version (3.1.5).

However, the package maintainers introduced a severe SemVer violation in 3.1.5 by completely removing or hiding the public HttpClientAdapter architecture and the setHttpClientAdapter helper method on OptionBuilder. This was causing local and CI/CD builds to fail with compilation errors:

  • The method 'setHttpClientAdapter' isn't defined for the type 'OptionBuilder'
  • The name 'HttpClientAdapter' isn't defined

The Solution

  • Removed the ^ from socket_io_client in pubspec.yaml to lock it strictly to 3.1.2.
  • Regenerated pubspec.lock to ensure the correct working version is pinned for all environment setups.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Cleared pub cache, ran flutter pub get, and verified that version 3.1.2 is successfully pulled.
  • Verified that the project compiles cleanly without any missing URI or method definition errors.

Greptile Summary

This PR's stated goal is to hard-pin socket_io_client to 3.1.2 to avoid a breaking change introduced in 3.1.5, but it also bundles a significant Android toolchain migration (Gradle 8→9, AGP 8→9, Kotlin 2.2→2.3) and several undocumented dependency changes.

  • socket_io_client caret removed to lock version to exactly 3.1.2; pubspec.lock should be verified to match (see existing thread).
  • flutter_inappwebview silently upgraded from stable ^6.1.5 to beta ^6.2.0-beta.3 without documentation, introducing a pre-release dependency into production.
  • Android build files migrated to AGP 9.0.1 / Gradle 9.1.0, with kotlinOptions moved to a top-level kotlin { compilerOptions } block and packagingOptions added; META-INF/LICENSE* exclusion and useLegacyPackaging = true warrant review.

Confidence Score: 4/5

The core socket_io_client pin is straightforward, but the undocumented bump of flutter_inappwebview to a beta release introduces a pre-release dependency into production that warrants attention before merging.

The flutter_inappwebview upgrade from stable ^6.1.5 to beta ^6.2.0-beta.3 is undocumented and ships a pre-release library in production — this is the main risk. The Android toolchain jump (AGP 8→9, Gradle 8→9) is significant but appears self-consistent.

pubspec.yaml (undocumented beta upgrade to flutter_inappwebview); android/app/build.gradle.kts (useLegacyPackaging and license exclusions)

Important Files Changed

Filename Overview
pubspec.yaml socket_io_client pinned to exact 3.1.2 (stated fix); flutter_inappwebview silently bumped from stable ^6.1.5 to beta ^6.2.0-beta.3 without mention in the PR description
android/app/build.gradle.kts kotlinOptions migrated to top-level kotlin { compilerOptions } block for AGP 9+ compatibility; packagingOptions added to exclude META-INF files; useLegacyPackaging = true for jniLibs has side-effects that contradict the comment about reducing APK size
android/settings.gradle.kts AGP bumped from 8.11.1 to 9.0.1 and Kotlin Android plugin from 2.2.20 to 2.3.20; significant toolchain jump with no compatibility notes
android/gradle/wrapper/gradle-wrapper.properties Gradle distribution updated from 8.14.3 to 9.1.0; major version bump tied to the AGP 9 migration
android/gradle.properties kotlin.incremental=false added to work around an incremental-cache issue; this will noticeably slow all Kotlin compilation going forward

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[pubspec.yaml] -->|socket_io_client| B["3.1.2 (exact pin, was ^3.1.2)"]
    A -->|flutter_inappwebview| C["^6.2.0-beta.3 ⚠️\n(was ^6.1.5 stable)"]

    D[settings.gradle.kts] -->|AGP| E["9.0.1 (was 8.11.1)"]
    D -->|Kotlin Android| F["2.3.20 (was 2.2.20)"]

    G[gradle-wrapper.properties] -->|Gradle| H["9.1.0 (was 8.14.3)"]

    I[build.gradle.kts] -->|ndkVersion| J["flutter.ndkVersion\n(was hardcoded 29.0.14206865)"]
    I -->|kotlinOptions| K["Commented out\nMoved to top-level kotlin {}"]
    I -->|packagingOptions added| L["META-INF exclusions\njniLibs useLegacyPackaging=true ⚠️"]

    M[gradle.properties] -->|kotlin.incremental| N["false (build slowdown)"]
Loading

Reviews (2): Last reviewed commit: "feat: added flutter 3.44 compatibility c..." | Re-trigger Greptile

Comment thread pubspec.yaml
pdfrx: ^2.4.3
flutter_inappwebview: ^6.1.5
socket_io_client: ^3.1.2
socket_io_client: 3.1.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 pubspec.lock still resolves 3.1.4, not 3.1.2

The committed pubspec.lock still pins socket_io_client to 3.1.4 (the sha256 and version fields are unchanged from the base commit). Any CI pipeline running dart pub get --enforce-lockfile — which many reproduce-build setups use — will fail immediately because 3.1.4 doesn't satisfy the new exact constraint 3.1.2. The lock file must be regenerated with flutter pub get and committed alongside this change for the fix to be complete and for the lock file to match what the PR description claims was already done.

Comment thread pubspec.yaml
pdfrx: ^2.4.3
flutter_inappwebview: ^6.1.5
socket_io_client: ^3.1.2
socket_io_client: 3.1.2

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Using an exact pin (3.1.2) completely blocks any future patch releases that fix unrelated bugs. A tighter upper bound accomplishes the same goal of excluding the broken 3.1.5 while still allowing safe earlier patches.

Suggested change
socket_io_client: 3.1.2
socket_io_client: ">=3.1.2 <3.1.5"

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@Mahdijamebozorg

Mahdijamebozorg commented Jun 13, 2026

Copy link
Copy Markdown
Author

About second commit:

before:
before

after:
after

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