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

Fixed crash and improve performance in AlbumsOverViewScreen #546

Merged

Conversation

rahul31124
Copy link
Contributor

This PR fixes a crash that happened when clicking on an album with no songs by adding proper null safety Checks a Toast is now shown if the album has 0 songs,also improves performance by use of LazyColumn instead of Column

Before

Crash_Issue_Before.mp4

After

Crash_Issue_After.mp4

@rahul31124 rahul31124 changed the title Fix crash and improve performance in AlbumsOverViewScreen Fixed crash and improve performance in AlbumsOverViewScreen Feb 2, 2025
@07jasjeet
Copy link
Collaborator

Hi @rahul31124, can you share what was the crash?

@rahul31124
Copy link
Contributor Author

Hi @07jasjeet,actually when we click on a album that has 0 song means nothing to play at that time the app crashes

@07jasjeet
Copy link
Collaborator

@rahul31124 I understand that but there might be some logs when the crash happened. Can you share those? We might need to fix these cases deeper in BP view-model rather than on call sites to avoid future crashes.

@rahul31124
Copy link
Contributor Author

@07jasjeet the logs i got

E [AppErrors] null InputStream [CONTEXT service_id=254 ]
java.io.IOException: null InputStream
at daoj.b(:com.google.android.gms@[email protected] (100400-713002902):184)
at damr.l(:com.google.android.gms@[email protected] (100400-713002902):7)
at daml.apply(:com.google.android.gms@[email protected] (100400-713002902):39)
at tet.apply(:com.google.android.gms@[email protected] (100400-713002902):5)
at tff.apply(:com.google.android.gms@[email protected] (100400-713002902):45)
at dwnz.a(:com.google.android.gms@[email protected] (100400-713002902):3)
at efzq.a(:com.google.android.gms@[email protected] (100400-713002902):13)
at enjz.d(:com.google.android.gms@[email protected] (100400-713002902):3)
at enkb.run(:com.google.android.gms@[email protected] (100400-713002902):38)
at enln.execute(:com.google.android.gms@[email protected] (100400-713002902):1)
at enjv.h(:com.google.android.gms@[email protected] (100400-713002902):1)
at enjv.hp(:com.google.android.gms@[email protected] (100400-713002902):40)
at enkb.g(:com.google.android.gms@[email protected] (100400-713002902):13)
at dwnr.a(:com.google.android.gms@[email protected] (100400-713002902):20)
at efzp.a(:com.google.android.gms@[email protected] (100400-713002902):13)
at enlu.a(:com.google.android.gms@[email protected] (100400-713002902):20)
at ennx.a(:com.google.android.gms@[email protected] (100400-713002902):3)
at enmy.run(:com.google.android.gms@[email protected] (100400-713002902):19)
at ennz.run(:com.google.android.gms@[email protected] (100400-713002902):5)
at enlw.run(:com.google.android.gms@[email protected] (100400-713002902):53)
at enln.execute(:com.google.android.gms@[email protected] (100400-713002902):1)
at enlw.execute(:com.google.android.gms@[email protected] (100400-713002902):76)
at enjv.h(:com.google.android.gms@[email protected] (100400-713002902):1)
at enjv.hp(:com.google.android.gms@[email protected] (100400-713002902):40)
at enly.b(:com.google.android.gms@[email protected] (100400-713002902):33)
at dwnv.i(:com.google.android.gms@[email protected] (100400-713002902):18)
at dwod.a(:com.google.android.gms@[email protected] (100400-713002902):10)
at efzq.a(:com.google.android.gms@[email protected] (100400-713002902):13)
at enjz.d(:com.google.android.gms@[email protected] (100400-713002902):3)
at enkb.run(:com.google.android.gms@[email protected] (100400-713002902):38)
at enln.execute(:com.google.android.gms@[email protected] (100400-713002902):1)
at enjv.h(:com.google.android.gms@[email protected] (100400-713002902):1)
at enjv.hp(:com.google.android.gms@[email protected] (100400-713002902):40)
at enkb.g(:com.google.android.gms@[email protected] (100400-713002902):13)
at dwob.a(:com.google.android.gms@[email protected] (100400-713002902):20)
at efzp.a(:com.google.android.gms@[email protected] (100400-713002902):13)
at enlu.a(:com.google.android.gms@[email protected] (100400-713002902):20)
at ennx.a(:com.google.android.gms@[email protected] (100400-713002902):3)
at enmy.run(:com.google.android.gms@[email protected] (100400-713002902):19)
at ennz.run(:com.google.android.gms@[email protected] (100400-713002902):5)
at enlw.run(:com.google.android.gms@[email protected] (100400-713002902):53)
at enln.execute(:com.google.android.gms@[email protected] (100400-713002902):1)
at enlw.execute(:com.google.android.gms@[email protected] (100400-713002902):76)
at enjv.h(:com.google.android.gms@[email protected] (100400-713002902):1)
at enjv.hp(:com.google.android.gms@[email protected] (100400-713002902):40)
at enly.b(:com.google.android.gms@[email protected] (100400-713002902):33)
at dwoj.c(:com.google.android.gms@[email protected] (100400-713002902):56)
at dwoj.b(:com.google.android.gms@[email protected] (100400-713002902):10)
at com.google.android.gms.stats.service.DropBoxEntryAddedChimeraService.a(:com.google.android.gms@[email protected] (100400-713002902):379)

@rahul31124
Copy link
Contributor Author

Hi @07jasjeet, just following up since you asked for the logs. Let me know if my changes are enough or if anything else is needed.

@07jasjeet
Copy link
Collaborator

These logs look irrelevant, are you sure these are the ones?

@rahul31124
Copy link
Contributor Author

@07jasjeet,Yes i am getting these logs additionally i have added my logs to see the title as well as the size.
1
Screenshot 2025-02-03 205344
2
Screenshot 2025-02-03 212149

@07jasjeet
Copy link
Collaborator

Please add package:com.listenbrainz.android.debug is:crash int the filter bar

@rahul31124
Copy link
Contributor Author

Screenshot 2025-02-03 213446

@07jasjeet
Copy link
Collaborator

@rahul31124 have you joined meb irc channel?

@rahul31124
Copy link
Contributor Author

Yes I Now I have joined

@rahul31124
Copy link
Contributor Author

May be There is a problem in the channel so i am sharing the screenshot here

Screenshot 2025-02-03 223504

@rahul31124
Copy link
Contributor Author

Hi @07jasjeet,
I believe the issue is most likely related to how Telegram marks or handles audio metadata. From my observation, when audio files are stored in the Telegram folder, the metadata might not be properly registered or updated in the MediaStore, causing inconsistencies with fetching and displaying the files correctly.

In the Play Store version, I didn't notice any Telegram albums showing up, which suggests that Telegram may handle file indexing differently.

Since this crash doesn't happen consistently, I think adding a null-safety check here would be a good precaution to prevent potential issues, especially with apps like Telegram that may have inconsistent metadata handling.

Copy link
Collaborator

@07jasjeet 07jasjeet left a comment

Choose a reason for hiding this comment

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

Looks good for now. Thanks for the contribution @rahul31124!

@07jasjeet 07jasjeet merged commit b42096a into metabrainz:main Feb 5, 2025
1 check passed
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.

2 participants