Skip to content

fix(better_networking): getEnabledRows uses row index, not indexOf (#1441)#1635

Open
AyushCoder9 wants to merge 1 commit intofoss42:mainfrom
AyushCoder9:resolve-issue-1441-getenabledrows-duplicates
Open

fix(better_networking): getEnabledRows uses row index, not indexOf (#1441)#1635
AyushCoder9 wants to merge 1 commit intofoss42:mainfrom
AyushCoder9:resolve-issue-1441-getenabledrows-duplicates

Conversation

@AyushCoder9
Copy link
Copy Markdown
Contributor

@AyushCoder9 AyushCoder9 commented Apr 5, 2026

PR Description

getEnabledRows filtered rows using rows.indexOf(element), which always resolves duplicate NameValueModel values to the first matching index. That made later duplicate rows incorrectly reuse the first row’s enabled flag.

This change uses index-based iteration so each row maps to isRowEnabledList[i].

Also removes the finalRows == [] ? null : finalRows branch so an all-disabled result returns [], matching existing tests.

Related Issues

Checklist

  • I have gone through the contributing guide
  • I have updated my branch and synced it with project main branch before making this PR
  • I am using the latest Flutter stable branch (run flutter upgrade and verify)
  • I have run the tests (flutter test) and all tests are passing

Added/updated tests?

We encourage you to add relevant test cases.

  • Yes
  • No, and this is why: please replace this line with details on why tests have not been included

OS on which you have developed and tested the feature?

  • Windows
  • macOS
  • Linux

Test plan

  • flutter test packages/better_networking/test/utils/http_request_utils_test.dart
  • flutter test packages/better_networking (optional)
  • flutter analyze packages/better_networking

Use index-based filtering instead of indexOf so duplicate NameValueModel
rows map to their own enabled flags. Add regression test.

Fixes foss42#1441
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.

bug(better_networking): getEnabledRows mis-filters duplicate rows

1 participant