Grapes - Bug
Notification says that I have accumulated 400 grapes, but it's displayed as 388 on home page. Also, not able to add more than one screenshot to show the home page screenshot
RealOldmonk
Stealth
9 months ago
Go to your profile and come back to feed it will sync, looks like its cached and the API call only happens when visiting the profile page, the notifications is independent of the state of the value cached in feed page hence the old value
FancyChino64
Stealth
9 months ago
thanks....this worked
This is called caching. Basically, they want to avoid making unnecessary API calls since every request cost them something ( the amount is however not substantial ) . They might be storing this data , let’s say in Redis which is a caching system. It has its predefined Time to live ( TTL ) . Once the TTL is expired , only then API call is made again and hence you see the delay in updating the grapes in home page.
Notification is independent of this concept
RealOldmonk
Stealth
9 months ago
This is on client side so redis is not the issue or even something to discuss here, gcp, aws, azure everyone charges for egress and they want to reduce this as much as possible hence the caching on client side. A better approach would have been a background thread which makes this API call in some duration and updates the object store, the rest pages can use this information. A properly defined schema to fetch current grapes will be in 2 digit ms, this is not a youtube hitcounter which is updating every ms
See more comments
FAT32
Stealth
9 months ago
Need some more grapes
Discover More
Curated from across