Comments (7)
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.
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.
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.
You're right. The rows point to the same submission. Looks like the problem lies somewhere else upstream.
from dank.
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.
@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.
Will be fixed with #6
from dank.
Related Issues (11)
- Please add a License HOT 1
- Add codestyle for contributions
- F-droid release HOT 1
- Support for third party YouTube client HOT 2
- Could not run the app after build HOT 2
- Giphy API Key HOT 3
- App Randomly crashes on Tablet HOT 3
- app crashing randomly after browsing for a while HOT 3
- Improve detection of markdown sent by Reddit
- Document contribution guidelines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dank.