-
Notifications
You must be signed in to change notification settings - Fork 226
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
Crash because podcast_episodes published_date column has null values #1572
Comments
I was able to sort of reproduce this issue by updating the DateTypeConverter to always return In particular, I saw the in my build the crash originated from a null publishedAt column in the generated My guess is that forcing the |
Turns out that the type converter change did not fix this error. It did change the exception a bit though, and I think that gave us a bit more information. In particular, it seems to confirm that there actually is a null value in the When we had the type converter capable of returning null, this was the relevant part of the generated code: if (_cursor.isNull(_cursorIndexOfPublishedDate)) {
_tmp = null;
} else {
_tmp = _cursor.getLong(_cursorIndexOfPublishedDate);
}
final Date _tmp_1 = __dateTypeConverter.toDate(_tmp);
if(_tmp_1 == null) {
throw new IllegalStateException("Expected non-null java.util.Date, but it was null.");
} else {
_tmpPublishedDate = _tmp_1;
} The "Expected non null java.util.Date" exception was thrown with this code. We tried to work around this by just having the type converter never return null in #1573, which resulted in this generated code: final Date _tmpPublishedDate;
final long _tmp;
_tmp = _cursor.getLong(_cursorIndexOfPublishedDate);
final Long _tmp_1;
_tmp_1 = _tmp; // No longer checking for null here because the type converter never returns null values
_tmpPublishedDate = __shouldNotBeNullDateTypeConverter.toDate(_tmp_1); That didn't work though. It did, however, give a new exception. Now we get an "IllegalStateException: Couldn't read row , col 2 from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it." from the line calling That is informative because that line never got called with the code generated from the nullable type-converter because the In other words, there is a null value in the data class PodcastEpisode(
// ...
@ColumnInfo(name = "published_date") override var publishedDate: Date // Date is not nullable here To verify this I ran an SQL query to manually update the More details about what
|
I've looked at the episode json files the server has been returning for the daily from the last few days for a bit, and I don't see anything suspicious or different about them. Admittedly they're large files, so it's not like I'm going over every detail in them, and I could be missing something, but I did do a regex check on all of the Also, if there was an issue about the server response that would cause this, I would think think that more than ~5k users would have been affected. It's possibly that the server could have returned a bad value only very briefly, if that were the case I wouldn't expect that we would be getting the same spike again each day at almost exactly the same time (which just happens to be shortly after "The Daily" releases a new episode). |
Closing this as fixed by #1589 |
Description
Starting on November 27, we've seen a significant increase in crashes caused by the app finding a
null
value is being found in thepublishedAt
column of thepodcast_episodes
database table. This shouldn't be possible because that column is not allowed to be null. and it's not clear what the cause is.This almost entirely seems to occur after users download the episode json for "The Daily" podcast. In addition, there is a sharp spike in these crashes early in the morning in the US (shortly after "The Daily" releases a new episode), and then very quickly falls off.
The number of affected user as of today (Nov. 29) is around 3.5k, so this does not seem to be a widespread issue. In addition, the issue is mostly occuring on the
7.51
release. This is likely because the7.52
release has just started rolling out so most of our users are on7.51
. It is interesting that the issue started on Nov. 27 though because that was well after the Nov. 27 release, which indicates that there were no code changes in the app that would have caused the issue to start.Step-by-step reproduction instructions
I don't know how to reproduce this.
Screenshots or screen recording
No response
Did you search for existing bug reports?
Device, Operating system, and Pocket Casts app version
No response
The text was updated successfully, but these errors were encountered: