Giter VIP home page Giter VIP logo

Comments (7)

Tunous avatar Tunous commented on August 30, 2024

I would like to try and fix this too.
@saket is there a way for us to know the reason why you added said method in this commit:
c6b6114 ? The link added in comment doesn't work for me.

from dank.

saket avatar saket commented on August 30, 2024

findCollidingIds() throws an error if two SubmissionRowUiModel items in the data-set have the same IDs. In this case, the collision is happening between items of SubredditSubmission.

The adapterId is generated here: JrawUtils2#L20. Fortunately or unfortunately this function is used for generating the adapter ID of multiple types of Reddit related objects.

I'm using a combination of hashcode + created-at-time in hopes that they'll be unique, but clearly that's wrong. Multiple submissions can have the same created-at timestamp, increasing their likelihood of collision.

@Tunous unfortunately, the Bugsnag dashboard is private so you won't be able to open the link. It doesn't have anything useful except for links to the two colliding submissions. I wonder if I can make my bugsnag dashboard public.

from dank.

DarkionAvey avatar DarkionAvey commented on August 30, 2024

But if you read the printed logcat (using Log.e), SubmissionRowUiModel 'existing' and 'row' are basically the same entry, so the issue isn't in findCollidingIds but somewhere upstream where an article is retrieved twice (?)

from dank.

saket avatar saket commented on August 30, 2024

You're right. The rows point to the same submission. Looks like the problem lies somewhere else upstream.

from dank.

Tunous avatar Tunous commented on August 30, 2024

I've debugged the bug a bit and found that the problem lies in part of code which deals with saving new submissions to local database:

The code inside of the linked if statement executes basically every time because saveTimeMillis is a part of primary key for CachedSubmissionId2. Since everything (including duplicates) fetched from the API is saved to the database we are getting id collisions.

I've fixed this bug by removing saveTimeMillis from the primary key for CachedSubmissionId2 and adding id here instead which seems to be something that is supposed to uniquely identify submissions.


@saket are you interested in accepting pull requests to this repository or would you prefer to leave everything up to forks?

from dank.

saket avatar saket commented on August 30, 2024

@Tunous just an information about the bug fix is sufficient, don't bother sending back patches to Dank. As much as I'd like them, I don't think I have enough time to maintain this app anymore.

from dank.

saket avatar saket commented on August 30, 2024

Will be fixed with #6

from dank.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.