-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Open
Labels
RSS bugSomething isn't workingSomething isn't working
Description
Routes
/mastodon/acct/:acct/statuses/:only_media?
Full routes
/mastodon/acct/[email protected]/statuses
Related documentation
https://docs.rsshub.app/joinus/advanced/use-cache
What is expected?
Numeric strings are fetched as strings
What is actually happening?
Numeric strings are not quoted when stored, and are later parsed as numbers, and precision is lost
RSSHub/lib/utils/cache/index.ts
Lines 80 to 97 in 781da24
| if (v) { | |
| let parsed; | |
| try { | |
| parsed = JSON.parse(v); | |
| } catch { | |
| parsed = null; | |
| } | |
| if (parsed) { | |
| v = parsed; | |
| } | |
| return v as T; | |
| } else { | |
| const value = await getValueFunc(); | |
| cacheModule.set(key, value, maxAge); | |
| return value; | |
| } |
Deployment information
Self-hosted
Deployment information (for self-hosted)
No response
Additional info
If some values need to be serialized as JSON, then all types should.
#20663 was an incorrect fix. I noticed that the error was caused by cache, but didn't identify the root cause.
This is not a duplicated issue
- I have searched existing issues to ensure this bug has not already been reported
dosubot
Metadata
Metadata
Assignees
Labels
RSS bugSomething isn't workingSomething isn't working