AOSSIE-Org / AOSSIE-Org/PictoPy

BUG:Favorite Icon Does Not Update on PersonImages Page

Đang mở
#681 2 bình luận 0 reaction 1 người được giao Được @Akash1xe nhận Xem trên GitHub
bug frontend
Ngôn ngữ chính
Python
Star
283
Fork
679
Merge trung bình
7 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Mô tả

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

Description

When clicking the favorite (heart) icon on an image inside the PersonImages (face collection detail) page, the backend updates successfully — the image is added/removed from Favorites — but the UI does not update.
The heart icon stays unchanged on the PersonImages page even though the favorite status actually changes.

However, the same image shows correctly (red heart) in the Favorites tab, confirming the backend is working.

Current Behavior

Clicking heart updates favorite on backend

UI on PersonImages page does not refresh

Heart icon stays same

Favorites tab shows the correct (updated) state

Cached query for PersonImages is never invalidated

Expected Behavior

The PersonImages UI should immediately reflect the new favorite state

Heart icon should turn red (favorited) or grey (unfavorited)

React Query should refetch using the correct key

UI should stay in sync with backend updates

Steps to Reproduce

Open any face collection → go to PersonImages

Click on the heart icon on any image

Open Favorites tab → image is correctly favorited

Return to PersonImages → heart icon remains unchanged

UI only updates after full page reload

### Record

- [x] I agree to follow this project's Code of Conduct

### Checklist before Submitting

- [ ] Have you updated docs for it?
- [x] Have you added unit tests?
- [x] Have you made sure unit tests pass?
- [x] Have you made sure code formatting is correct?
- [x] Do Your changes passes all tests?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

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

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.