Using groupBy filter with ng-repeat in template on iOS9 iPhone4 causes infinite repeating
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angularjs, javascript
Research direction
The issue is about the groupBy filter causing infinite repeats on iOS9 iPhone4. Start by examining the groupBy filter implementation in the angular-filter library. Reproduce the bug in an iOS9 simulator or device with the provided template code. Look for differences in JavaScript execution or AngularJS digest cycles on iOS9. Check if the filter is stable and if it modifies the array in place. The fix likely involves ensuring the filter output is deterministic and doesn't trigger infinite $digest loops.
Written by the indexing model from the issue text.
Description
I found that when using the groupBy filter within the template with an ng-repeat that iPhone4 on iOS9 would infinitely repeat the data, causing it to crash the browser if there was a particularly large set of data. This behaviour didn't present on any other devices I was testing (desktop Chrome, FF, IE9+, Android device using Chrome browser) including an iPhone 4 on iOS8.
An example of the template code I was using is as follows (where groupingMonth is an attribute of data):
<div ng-repeat="group in data | groupBy: 'groupingMonth' | toArray:true | orderBy: '$key': true">
I ended up being able to resolve the problem for my current purposes by moving the filters into the controller, eg:
$scope.groupedData = $filter('orderBy')($filter('toArray')($filter('groupBy')($scope.data, 'groupingMonth'), true), '$key', true);
<div ng-repeat="group in groupedData">
Either the groupBy filter shouldn't be used in the ng-repeat and perhaps something documented to say as such would help others, or something has fundamentally changed with iOS9 which causes this behaviour regardless of how the filter is written. I investigated as much as I could but wasn't able to pin down why this behaviour presents in iOS9 and not iOS8. I used angular-filter v0.5.5 and tried upgrading to 5.5.8 with the same behaviour seen on both.
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 319
- PR merge metrics
- No merged PRs in 30d
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from a8m/angular-filter
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#267 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
a8m/angular-filter#260 · 1 reaction ·
-
KiB and MiB are wrongly used in place of kB and MBPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#254 · 2 comments · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#250 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
a8m/angular-filter#208 · 1 comment · 1 reaction ·
All issues in a8m/angular-filter
Similar issues
-
macOS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
beyondcode/herd-community#1761 ·
-
content good first issue hacktoberfest
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
vieanderes/understory#19 ·
-
automated issue report
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
lirantal/discoprint#37 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tauri-apps/tauri#16219 ·
Maintainers usually reply within 2 days
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 90/100
githubnext/gh-aw-cao#16599 ·
Maintainers usually reply within 1 day