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

added better error handling when article has been cleared from cache #447

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

asl97
Copy link
Contributor

@asl97 asl97 commented Dec 7, 2024

For feed if for some reason cache was cleared.

Ideally, at least the non full article shouldn't be written into the cachedir as it is a key part of the whole "Offline reading" mentioned in Features.

https://developer.android.com/training/data-storage/app-specific#internal-remove-cache

Caution: When the device is low on internal storage space, Android may delete these cache files to recover space. So check for the existence of your cache files before reading them.

I did accidentally put a huge git repo recently into a syncthing folder which I deleted afterwards but that might had cause the article to get deleted due to running very low on storage space

This hotfix is not ideal but at least it's something, as I doubt it would be possible to retrieve the lost data. screenshot:
Screenshot_20241208-011326

I would appreciate if you could fix the tag on #443 too
Having an situation where the feed get lost ('Found nothing to fetch') is a bug.

For feed if for some reason cache was cleared
Copy link
Owner

@spacecowboy spacecowboy left a comment

Choose a reason for hiding this comment

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

So the problem here is that you are removing the feedback to the user that something went wrong.

The current situation is certainly not the best, but this will lead to confusing bug reports where sometimes the snippet is shown instead of the real text.

@spacecowboy
Copy link
Owner

Instead, could you perhaps update where the articles are saved?

override val articleDir: File = cacheDir.resolve("articles")

@asl97
Copy link
Contributor Author

asl97 commented Dec 11, 2024

Instead, could you perhaps update where the articles are saved?

override val articleDir: File = cacheDir.resolve("articles")

This is just a quick hot fix, and changing the location wouldn't help for already deleted saved article.

Not to mention migrating exisiting articles from the cachedir to another location is a bit out of my league, where the maintainer of this project with more knowledge would be more suited to do.

I do not want to the cause for even more article to get deleted because I mess up the migration.

@asl97
Copy link
Contributor Author

asl97 commented Dec 11, 2024

So the problem here is that you are removing the feedback to the user that something went wrong.

The current situation is certainly not the best, but this will lead to confusing bug reports where sometimes the snippet is shown instead of the real text.

IMO, Found nothing to fetch is not much of a feedback, but if you want a more clear feedback for the user, sure.

Screenshot_20241211-213922

@spacecowboy
Copy link
Owner

@asl97 just run ./gradlew ktlintformat to fix the ktlint stuff

@spacecowboy spacecowboy changed the title [Hotfix] Show snippet of feed instead of "Found nothing to fetch" added better error handling when article has been cleared from cache Dec 16, 2024
@spacecowboy spacecowboy enabled auto-merge (squash) December 16, 2024 21:51
@spacecowboy spacecowboy disabled auto-merge December 16, 2024 21:52
@spacecowboy spacecowboy merged commit 029c249 into spacecowboy:master Dec 16, 2024
2 checks 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