Skip to content

[Bounty proposal] fix(backend): goal progress history is bucketed by UTC day, not the user's own ($50 proposed) #15206

Closed

Description

@Abhist17

Summary

_append_goal_progress_event and save_goal_progress_history in database/goals.py key goal_history documents by:

now = datetime.now(timezone.utc)
history_ref.document(now.strftime('%Y-%m-%d')).set(...)

A user west of UTC (e.g. US Pacific, UTC-7/8) whose local evening hasn't yet crossed UTC midnight gets their progress update written into tomorrow's UTC-dated document. East of UTC, the reverse: an update from their own morning lands in yesterday's bucket. GET /v1/goals/{id}/history (database.goals.get_goal_history, ordered by the date field, days=30 default) returns a chart whose day boundaries don't line up with the user's own calendar for any user not on UTC.

Same bug class as the already-fixed proactive-notification daily cap, which switched from raw UTC bucketing to resolve_user_timezone(uid).

Fix

Bucket both write sites by the user's own calendar day, resolving the zone with resolve_user_timezone the same way the notification cap does, falling back to UTC if the zone is missing or unresolvable.

Bounty: $50 proposed.

PR with the fix and regression tests follows.

Activity

  1. Abhist17 commented on Sep 20, 2026

    @Abhist17
    ContributorAuthor

    Opened #15209 for this (linked with Fixes #15206).

  2. moved this from Someday to In progress in omi TODO / bountieson Sep 20, 2026
  3. Abhist17 commented on Sep 20, 2026

    @Abhist17
    ContributorAuthor

    Heads up for reviewers: the "I have solved the issue... ready to submit the $50 payment upon your approval" comment above (from alienvisitor8675-bit) has no PR attached, and the pasted "Automated Solution Generated" snippet doesn't actually work — it imports resolve_user_timezone from a nonexistent utils module and calls .astimezone() on a plain timezone-name string instead of a ZoneInfo object. Same account posted an identical templated "I've solved it, pay me" comment (also with no PR) on #15195, a different bug. Looks like a bounty-scraping bot pattern, not a real submission.

    The actual fix with tests is here: #15209.

  4. moved this from In progress to In review in omi TODO / bountieson Sep 21, 2026
  5. Abhist17 commented on Sep 21, 2026

    @Abhist17
    ContributorAuthor

    Merged as #15209 (by @kodjima33, 2026-09-21). Claiming the proposed $50 per the contribution guide's bounty rules — sending the link to [email protected]. Payout: EVM 0x49A441f63f00b1978Aa4DD4ff52C237a4A7FdF82 or Solana FQetSNNrMouXQ1W3hzCunkd3V5kyvvBtKxQZ2mWfksxV (USDC/USDT fine). Thanks for the quick turnaround on the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions