[BUG] A slow Today’s Focus load can overwrite a newer goal

Đang mở
#4,059 3 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Junaid2-7777 đang làm issue này rồi.

Từ ngày 3/12/2026.

  • #4061 của @Junaid2-7777 — đang mở

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug needs-triage status:assigned
What happened?

The Today’s Focus form remains usable while its initial GET is pending. If that request returns a previously saved goal after I save a new one, TodayFocusHero applies the older response to both the UI and localStorage. The most recent save should stay visible and survive reloads using the local cache.

Steps to reproduce
  1. In local development or a component test, delay the initial /api/daily-focus?date=… response with an existing goal; let the POST respond normally.
  2. Before the GET resolves, enter and save a different goal.
  3. Resolve the GET with the old goal. The current response handler overwrites the just-saved goal in the card and localStorage.

Found by tracing src/components/TodayFocusHero.tsx on main; no production requests made. I’d like to add a deferred-response regression test and guard against a stale read after a local change.

Where is it?

Dashboard overview

Where did you see it?

Local development

Browser and device

No response

Screenshots, console errors or logs

No response

Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
Ngôn ngữ chính
TypeScript
Star
246
Fork
436
Merge trung bình
9 giờ 33 phút
Pull request đã merge (30 ngày)
213

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Priyanshu-byte-coder/devtrack

Tất cả issue của Priyanshu-byte-coder/devtrack

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.