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

Open Beginner friendly
#112 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
dart, flutter
Domain
mobile-dev

Research direction

The compile error points to lib/src/core/events/event_processor.dart around line 375, where a switch on e.type over DioExceptionType lacks a case for transformTimeout. Read that switch and the surrounding error handling, then compare against the DioExceptionType enum in dio's dio_exception.dart. Done means the package analyzes cleanly against dio 5.10 and later, either by adding the missing case or a default branch, with the existing event processor behavior unchanged for other types.

Written by the indexing model from the issue text.

Description

Version 5.10 of Dio added a new DioExceptionType type. Since flagsmith switch (e.type) to match cases, it needs to include the new types:

../../../.pub-cache/hosted/pub.dev/flagsmith-6.3.0/lib/src/core/events/event_processor.dart:375:15: Error: The type 'DioExceptionType' is not exhaustively matched by the switch cases since it doesn't match 'DioExceptionType.transformTimeout'.
 - 'DioExceptionType' is from 'package:dio/src/dio_exception.dart' ('../../../.pub-cache/hosted/pub.dev/dio-5.11.1/lib/src/dio_exception.dart').
Try adding a default case or cases that match 'DioExceptionType.transformTimeout'.
    switch (e.type) {
              ^

See also: https://github.com/cfug/dio/issues/2547#issuecomment-4841979338

Alternatively, pin dio to < 5.10.0
Alternatively alternatively, provide a default match.

Dominant language
Dart
Stars
17
Forks
18
Avg merge
3d 16h
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Flagsmith/flagsmith-flutter-client

All issues in Flagsmith/flagsmith-flutter-client

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.