Skip to content

fix: update Dio to 5.11.1 and handle transformation timeouts - #116

Open
MohamedGawdat wants to merge 3 commits into
Flagsmith:mainfrom
MohamedGawdat:fix/dio-transform-timeout-compatibility
Open

MohamedGawdat wants to merge 3 commits into
Flagsmith:mainfrom
MohamedGawdat:fix/dio-transform-timeout-compatibility

Conversation

@MohamedGawdat

@MohamedGawdat MohamedGawdat commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Update Dio to ^5.11.1 and add DioExceptionType.transformTimeout to the event processor's retryable timeout cases. This resolves the non-exhaustive switch compilation error. The lockfile records Dio 5.11.1.

Fixes #112.

Validation: the existing test suite passes with Dio 5.11.1 (227 passed, 1 existing skipped test), dart analyze reports no issues, and formatting checks pass.

What: Handle transformation timeouts as transient event-delivery failures,
add regression tests, and test locked and latest Dio versions in CI.

Why: Dio 5.10 added an enum value that made event processing fail to compile.
Matching the new value by name preserves compatibility with older Dio
versions. Await the initial flush in the cooldown test to avoid a timer race.

How to test: Run flutter test and dart analyze with Dio 5.3.2 and 5.11.1.
@MohamedGawdat
MohamedGawdat requested a review from a team as a code owner November 25, 2026 14:34
@MohamedGawdat
MohamedGawdat requested review from kyle-ssg and removed request for a team November 25, 2026 14:35

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 3 files

Confidence score: 5/5

  • flagsmith_experiments_test.dart covers retry/drop logging but does not verify the emitted logs or follow the required Given/When/Then structure. Add the scenario comments and expected-log assertions per AGENTS.md TE03/TE05.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/fg/flagsmith_experiments_test.dart">

<violation number="1" location="test/fg/flagsmith_experiments_test.dart:761">
P3: These new cases exercise retry/drop logging but do not assert the emitted logs or include the required Given/When/Then sections. Add scenario comments and expected-log assertions to each case, per `AGENTS.md` TE03/TE05.</violation>
</file>

Reply to a comment to ask cubic a question or push back. It learns from your replies.

Re-trigger cubic

Comment thread test/fg/flagsmith_experiments_test.dart Outdated
// Resolve by name so these tests also compile with Dio before 5.10.0.
for (final type in DioExceptionType.values
.where((type) => type.name == 'transformTimeout')) {
test('When every response transformation times out, then batch is kept',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: These new cases exercise retry/drop logging but do not assert the emitted logs or include the required Given/When/Then sections. Add scenario comments and expected-log assertions to each case, per AGENTS.md TE03/TE05.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At test/fg/flagsmith_experiments_test.dart, line 761:

<comment>These new cases exercise retry/drop logging but do not assert the emitted logs or include the required Given/When/Then sections. Add scenario comments and expected-log assertions to each case, per `AGENTS.md` TE03/TE05.</comment>

<file context>
@@ -755,6 +755,66 @@ void main() {
+    // Resolve by name so these tests also compile with Dio before 5.10.0.
+    for (final type in DioExceptionType.values
+        .where((type) => type.name == 'transformTimeout')) {
+      test('When every response transformation times out, then batch is kept',
+          () async {
+        dio.interceptors.add(InterceptorsWrapper(onRequest: (options, h) {
</file context>

What: Restore the existing CI workflow and tests.
Why: Keep this change focused on the Dio transformation-timeout build error.
How to test: Run the existing test suite and dart analyze with Dio 5.11.1.
@MohamedGawdat MohamedGawdat changed the title fix: support Dio 5.10+ transformation timeouts fix: handle Dio transformTimeout in event processing Nov 25, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

What: Require Dio ^5.11.1, update its lockfile entry, and explicitly handle
DioExceptionType.transformTimeout in the event processor.
Why: Handle every Dio error type so event processing compiles successfully.
How to test: Run the existing Flutter tests and dart analyze with Dio 5.11.1.
@MohamedGawdat MohamedGawdat changed the title fix: handle Dio transformTimeout in event processing fix: update Dio to 5.11.1 and handle transformation timeouts Nov 25, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@MohamedGawdat

MohamedGawdat commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@emyller @khvn26 could you take a look plz

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.

Flagsmith 6.3 should support newer versions of Dio (or pin to a lower Dio version)

1 participant