Replies: 1 comment
-
|
The short answer is that the codebase is old and there's a lot of tech debt. The use of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am investigating a bug where some threads just are not archived and stumbled upon this (and many other lines of code): https://github.com/FossifyOrg/Messages/blob/main/app/src/main/kotlin/org/fossify/messages/adapters/ThreadAdapter.kt#L110
So...I never looked into this codebase before and not a big android programmer, but this seems just wrong. hashCode is a function that generates a hash (with potential collision). The function
hashCode() = 0is totally valid, though performance would be sacrificed. Actions are performed on this hash (like here https://github.com/FossifyOrg/Messages/blob/main/app/src/main/kotlin/org/fossify/messages/adapters/ConversationsAdapter.kt#L178 or while deleting https://github.com/FossifyOrg/Messages/blob/main/app/src/main/kotlin/org/fossify/messages/adapters/ConversationsAdapter.kt#L209). This is REALLY unsafe. Actions might have unseen consequences and delete therads that are not acutally meant.I don't know how android identifies threads for messaging, but the conversation dataclass has a
threadId, so why not use this?Why is the
MyRecyclerViewListAdaptereven using an int for keys? Why not just the object?Sorry If I get something totally wrong here, then please correct me.
Beta Was this translation helpful? Give feedback.
All reactions