pln-planning-tools / Starmap

Roadmap Planning Tool
https://starmap.site
Other
20 stars 8 forks source link

feat(sw): Starmap Content Updated, Please Refresh #323

Closed whizzzkid closed 1 year ago

whizzzkid commented 1 year ago

Closes: #304

https://user-images.githubusercontent.com/1895906/220411995-0f51f513-1164-4d97-8ae5-1cb3fb0274e4.mov

In this PR:

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
starmaps ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 23, 2023 at 10:59AM (UTC)
whizzzkid commented 1 year ago

@SgtPooki:

  1. it seems like the page constantly refreshes even when i don't click the notification.

That behaviour was auto-refresh and has been removed.

  1. toast notification shows up while still loading (skeleton loader still visible; i.e. globalLoadingState === true)

Fixed that by using the globalLoadingState + storing in localStorage to keep of track of URLs for which we already showed the toast (or is it the first time loading) this is a naive way of tracking this.

  1. doesn't seem to require a manual refresh, and I think it should.

fixed.

  1. but the popup is still showing even after reloading. it seems to always show. Could be a problem with the hash function?

The hash function was actually working as expected, it was a deeper issue with how the cache-key was being computed. The roadmap you were seeing it on has issues with multiple parents. e.g.

Issue: https://github.com/protocol/bedrock/issues/5 has:

The cache entry did not account for this ${owner}/${repo}/${issue_number} this caused the cache to always update, first where the parent is 1 and then where parent is 2. This generated two hashes for the same cache key, causing the toast to believe that the content has been added. In the new scheme, ${owner}/${repo}/${issue_number}/${node_id} parent's node_id has been appended. While this is not 100% fool-proof (what if children has multiple grand-parents) it would resolve issues one level above.