Worker: cheap 'rides newer than X' probe endpoint
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
Research direction
Start in worker.js with the sibling authenticated endpoints, resolveSession, and their CORS/OPTIONS handling. Add the GET /activities/newer-than endpoint using the specified activity count query and convert the since value from milliseconds to seconds. Verify dead sessions return 401, preflight works, and the response contains the expected count.
Written by the indexing model from the issue text.
Description
The client-side merge UX for webhook auto-sync (epic #177) needs to know, on page load, whether D1 has rides the local IDB cache doesn't — without re-running the full /sync/recent loop.
Scope
GET /activities/newer-than?session=<token>&since=<unix-ms> →
{ "count": <n> }
- Resolve
session→athlete_idvia the existingresolveSession(401 on a dead token, same as the other authed endpoints). - One query:
SELECT COUNT(*) FROM activities WHERE user_id = ? AND has_power = 1 AND start_time > ?(notestart_timeis unix seconds in D1;sincecomes in as ms from the frontend's IDB shape — divide). - CORS + OPTIONS handling like the sibling endpoints in
worker.js.
The frontend calls this with its max cached startTime; a non-zero count drives the notify toast / auto pull.
Part of #177.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1m
- Merged PRs (30d)
- 2
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 iammike/power-predict
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 68/100
iammike/power-predict#247 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 56/100
iammike/power-predict#245 ·
-
idea testing
Difficulty 5/5 Over a week Newbie friendliness 28/100
iammike/power-predict#224 ·
-
epic
Difficulty 5/5 Over a week Newbie friendliness 30/100
iammike/power-predict#177 ·
-
epic idea
Difficulty 5/5 Over a week Newbie friendliness 35/100
iammike/power-predict#146 ·
All issues in iammike/power-predict
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·