SparkDevNetwork / Rock.Mobile-Issues

3 stars 2 forks source link

[Issue]: Group Finder Crashes on Android #25

Open melissadrexler opened 6 months ago

melissadrexler commented 6 months ago

Describe the Issue in Detail

When an Android device tries to load groups using the Group Finder block, it crashes (depending on the number of results). It briefly loads the results, and then the app closes.

Can reproduce in

Steps to Reproduce

  1. Add group finder block to a page using groups that will result in 100+ groups
  2. Use the Search option
  3. Notice the crash behavior

Expected Behavior

Android devices would not crash on the page loading (iOS devices are fine).

Actual Behavior

Android devices load the search results but then crashes the app.

Screenshots or Videos

https://drive.google.com/file/d/15X_PsYYWv_8af0iiNtvJx75dazkmpLjM/view?usp=sharing

Screen Shot 2024-02-23 at 2 35 04 PM Screen Shot 2024-02-23 at 2 35 20 PM Screen Shot 2024-02-23 at 2 35 26 PM

Reproduction XAML

{% if Groups == empty %}
    <StackLayout StyleClass="mt-6,p-12" Spacing="12">
        <Label StyleClass="text-md,font-weight-bold,text-center" 
            TextColor="#222222"  
            Text="No Circles match your current filters. Please try adjusting them or checking back soon for more Circles!"/>
    </StackLayout>
{% else %}
    <StackLayout StyleClass="p-12">
        <Rock:Divider />
        {% assign groupsSorted = Groups | Sort:'Name' %}
        {% for group in groupsSorted %}
        {% assign distance = Distances[group.Id] %}
        <Grid ColumnDefinitions="1*, 15" ColumnSpacing="12" StyleClass="group-content">
            {% if DetailPage != null %}
                {% assign groupGuid = group.Guid %}
                {% assign groupId = group.Id %}
                {% if groupId == 322553 or groupGuid == '73506f83-a4d9-41f4-83bd-6112e46d68ac' %}
                    <Grid.GestureRecognizers>
                        <TapGestureRecognizer Command="{Binding PushPage}" CommandParameter="4ed0d1f5-d7f4-491d-a991-9b8f091e750a?GroupGuid={{ group.Guid }}" />
                    </Grid.GestureRecognizers>
                {% else %}
                    <Grid.GestureRecognizers>
                        <TapGestureRecognizer Command="{Binding PushPage}" CommandParameter="{{ DetailPage }}?GroupGuid={{ group.Guid }}" />
                    </Grid.GestureRecognizers>
                {% endif %}
            {% endif %}
            <StackLayout Grid.Column="0" StyleClass="group-primary-content">
                <Label Text="{{ group.Name | Escape }}" StyleClass="group-name" />
                {% if group.Schedule.WeeklyTimeOfDay != null %}
                    <Label Text="Weekly at {{ group.Schedule.WeeklyTimeOfDayText }} on {{ group.Schedule.WeeklyDayOfWeek }}" HorizontalOptions="Start" StyleClass="group-meeting-time" />
                {% elsif group.Schedule != null %}
                    <Label Text="{{ group.Schedule.FriendlyScheduleText }}" HorizontalOptions="Start" StyleClass="group-meeting-time" />
                {% endif %}
                <!--
                {% if group.Schedule.WeeklyDayOfWeek != null %}
                    <Label Text="{{ group.Schedule.WeeklyDayOfWeek }}" TextColor="#222222" />
                {% endif %}
                -->
                <!--
                <StackLayout Orientation="Horizontal">
                    {% if group.Schedule.WeeklyTimeOfDay != null %}
                        <Label Text="Weekly at {{ group.Schedule.WeeklyTimeOfDayText }} on {{ group.Schedule.WeeklyDayOfWeek }}" HorizontalOptions="Start" StyleClass="group-meeting-time" />
                    {% elsif group.Schedule != null %}
                        <Label Text="{{ group.Schedule.FriendlyScheduleText }}" HorizontalOptions="Start" StyleClass="group-meeting-time" />
                    {% endif %}
                    {% assign topic = group | Attribute:'Topic' %}
                    {% if topic != empty %}
                        <Label Text="{{ topic | Escape }}" HorizontalTextAlignment="End" HorizontalOptions="EndAndExpand" StyleClass="group-topic" />
                    {% endif %}
                </StackLayout>
                -->
                <!--
                {% if distance != null %}
                    <Label Text="{{ distance | Format:'#,##0.0' }} mi" StyleClass="group-distance" />
                {% endif %}
                -->
                <Label Text="{{ group | Attribute:'Summary' | Escape }}" />
                {% assign topic = group | Attribute:'Topic' %}
                {% if topic != empty %}
                    <Label Text="{{ topic | Escape }}" StyleClass="group-topic" />
                {% endif %}
            </StackLayout>

            <Rock:Icon IconClass="chevron-right" Grid.Column="1" HorizontalOptions="End" VerticalOptions="Center" StyleClass="group-more-icon" />
        </Grid>

        <Rock:Divider />
        {% endfor %}
    </StackLayout>
{% endif %}

Mobile Shell Version

v5

Last Known Working Version

None

iOS Device Type(s) and iOS Version(s)

N/A

Android Device Type(s) and Android Version(s)

Google Pixel running Android 13; many other devices reported as well

bradencohen commented 5 months ago

Hey Melissa, would you mind stripping down your reproduction XAML to be a minimal version that reproduces the bug? Struggling to reproduce this on our end, and we suspect it may be related to the XAML.

melissadrexler commented 5 months ago

Sure! I believe this is pretty stripped down. I think the biggest thing is just the number of groups being returned; we use the same block on another page that has a max of like 30 groups at a time and it works fine.

`{% if Groups == empty %}

{% else %}

{% assign groupsSorted = Groups | Sort:'Name' %} {% for group in groupsSorted %} {% if DetailPage != null %} {% assign groupGuid = group.Guid %} {% assign groupId = group.Id %} {% endif %} {% endfor %} {% endif %}`