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

🐛 Fixes issue in ObservableList while using Iterables. #942

Conversation

ParthBaraiya
Copy link
Contributor

@ParthBaraiya ParthBaraiya commented Oct 14, 2023

Describe the changes proposed in this Pull Request.

This PR Fixes issue #941 .


Pull Request Checklist

  • If the changes are being made to code, ensure the version in pubspec.yaml is updated.
  • Increment the major/minor/patch/patch-count, depending on the complexity of change
  • Add the necessary unit tests to ensure the coverage does not drop
  • Update the Changelog to include all changes made in this PR, organized by version
  • Run the melo run set_version command from the root directory
  • Include the necessary reviewers for the PR
  • Update the docs if there are any API changes or additions to functionality

Copy link
Member

@pavanpodila pavanpodila left a comment

Choose a reason for hiding this comment

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

Also need pubspec update, changelog and running the melos run set_version command to update the lib/mobx.dart file

@@ -336,7 +341,7 @@ class ObservableList<T>
if (iterable.isNotEmpty) {
final oldValues = _list.sublist(index, index + iterable.length);
final newValues = iterable.toList(growable: false);
Copy link
Member

Choose a reason for hiding this comment

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

newValues can be created first and then used to fetch the length. That way the previous call on iterable.length is not needed (which actually forces a complete walk of the iterable)

@ParthBaraiya ParthBaraiya force-pushed the feat/fix-issue-iterator-issue-in-observable-list branch 2 times, most recently from cfe5f81 to d10b325 Compare October 16, 2023 14:29
@ParthBaraiya
Copy link
Contributor Author

Hi @pavanpodila , I've made necessary changes in the PR

But while running melos run set_version command it was not doing anything but to open expose_version.dart file in Text editor. So, I had to update the melos.yaml file as well. Hope that's OK.

@ParthBaraiya ParthBaraiya force-pushed the feat/fix-issue-iterator-issue-in-observable-list branch from d10b325 to 558aed3 Compare October 16, 2023 14:31
Copy link
Member

@pavanpodila pavanpodila left a comment

Choose a reason for hiding this comment

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

thanks for fixing the melos script. We have one change in flutter_mobx due to a lagging version update. Can you please include a small changelog for that..might require reading the git log

@@ -1,4 +1,4 @@
// Generated via set_version.dart. !!!DO NOT MODIFY BY HAND!!!

/// The current version as per `pubspec.yaml`.
const version = '2.0.6+5';
Copy link
Member

Choose a reason for hiding this comment

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

looks like this version was lagging behind and got updated once the set_version was run. Could you please include a changelog entry for this by reading the changes done in the past version.

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #942 (1143021) into master (4539e69) will increase coverage by 1.00%.
The diff coverage is n/a.

❗ Current head 1143021 differs from pull request most recent head e951de2. Consider uploading reports for the commit e951de2 to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #942      +/-   ##
===========================================
+ Coverage   98.99%   100.00%   +1.00%     
===========================================
  Files          57         6      -51     
  Lines        1990       100    -1890     
===========================================
- Hits         1970       100    -1870     
+ Misses         20         0      -20     
Flag Coverage Δ
flutter_mobx 100.00% <ø> (ø)
mobx ?
mobx_codegen ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 51 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4539e69...e951de2. Read the comment docs.

@pavanpodila
Copy link
Member

one of the test has failed with this change. pls see @ParthBaraiya

@ParthBaraiya ParthBaraiya force-pushed the feat/fix-issue-iterator-issue-in-observable-list branch from 9806ae9 to e951de2 Compare October 17, 2023 15:41
@ParthBaraiya
Copy link
Contributor Author

thanks for fixing the melos script. We have one change in flutter_mobx due to a lagging version update. Can you please include a small changelog for that..might require reading the git log

Looks like you have already merged a changes for this on master.

@ParthBaraiya
Copy link
Contributor Author

one of the test has failed with this change. pls see @ParthBaraiya

This is fixed.

@pavanpodila pavanpodila merged commit 6833ba1 into mobxjs:master Oct 18, 2023
4 checks passed
@pavanpodila
Copy link
Member

@all-contributors add @ParthBaraiya for code, bug

@allcontributors
Copy link
Contributor

@pavanpodila

I've put up a pull request to add @ParthBaraiya! 🎉

@amondnet amondnet added this to the mobx-2.2.1 milestone Oct 25, 2023
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.

None yet

3 participants