"GetNewPosts" the option "timeframe: 'week' but it still fetches ALL post and not that submitted in a Week
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- api
Research direction
Start at the GetNewPosts entry point and trace how the timeframe option is applied when fetching posts. Reproduce the issue with timeframe set to "week" and compare the returned posts' creation dates. Done means the result contains only posts submitted within the requested week, with a regression test if the existing test structure supports it.
Written by the indexing model from the issue text.
Description
Details
"GetNewPosts" the option "timeframe: 'week' but it still fetches ALL post and not that submitted in a Week
Additional info
Discord message: _I experienced the same. Got a timeframe "week" but it fetches all posts. I allready told <@892039441093365801> about it. Seems to be a Problem with ReddtiAPI maybe?
This is how i got around:
> const oneWeekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000;
>
> YOUR CODE
>
> // Filter timeframe before return
> const recentPosts = posts.filter(post => {
> const postCreatedAt = new Date(post.createdAt).getTime();
> return postCreatedAt >= oneWeekAgo;_
Message author: .robmc
Discord link: https://discord.com/channels/1050224141732687912/1050227353311248404/1295649436034269255
- Dominant language
- TypeScript
- Stars
- 210
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reddit/devvit
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 42/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·