stiftelsen-effekt / main-site

Repo for Gi Effektivt website front-end
https://www.gieffektivt.no
MIT License
4 stars 6 forks source link

[Bug]: Articles page is bugging #953

Closed SofieSjostrand closed 5 months ago

SofieSjostrand commented 5 months ago

Contact Details

sofie@geeffektivt.se

What happened?

Following issues:

  1. When publishing, it randomly starts showing unpublished articles on the website (see screenshot)
  2. Ingress is present even when no ingress is added (see article about Arvid winning award)
  3. When previewing, it leads to an inaccurate adress where artiklar is spelled artikler producing a 404
  4. At times it seems to cache different versions for different people that won't update even though cache is cleared making it hard to see changes. Skärmavbild 2024-04-03 kl  15 52 36

Reproduction steps

1. 2. 3. ...

What device are you seeing the problem on?

Desktop

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

EliseAndresen commented 5 months ago

@SofieSjostrand Noticed the bottom preview banner/text. Does this also happen when not in preview?

SofieSjostrand commented 5 months ago

Ah! It's a me problem:) Strike issue 1. Sending screenshots for issues 2. & 3. Issue 4 might have been resolved when Adam made some update a few weeks ago but it's hard for me to tell since I only see what I see and we haven't shared screenshots with each other since that update happened. But if you can check if the front page has an easter campaign and if the picture of the hands has a background or not in your version that would confirm. On my end no easter and no background.
Skärmavbild 2024-04-04 kl  18 46 52 Skärmavbild 2024-04-04 kl  18 47 45

Also, yay me for learning how to use Github! :D

fellmirr commented 5 months ago

preview.page.ts in next api routes is the offender, it must check which environment it's in

fellmirr commented 5 months ago

I'm pushing a temp solution where we check the dataset when opening a preview. It would be better to actually query for the sub-path slug directly in sanity, but that update should be done when we get the new async function in Sanity v3:

https://www.sanity.io/docs/migrating-production-url-resolver

SofieSjostrand commented 5 months ago

I am sure this is good news but I have absolutely no idea what I just read :D

fellmirr commented 5 months ago

My bad, mostly a note to self! It's just to remember a technical detail from when we upgrade from Sanity 2 -> 3

I've now done the following:

When it comes to the cache issues it's a little hard to tell unless we have a concrete case to look at, will you let me know next time it happens?

I could also add that this page sucks a bit in general, it's hard to get a good overview and it doesn't really invite the reader to explore more (boring).

But articles are mostly getting traffic from social media AFAIK, so we have not prioritised doing anything here in the near future (other than fixing obvious bugs of course, very helpful when those are reported!)

Anything in this issue that remains, or am I okay to close this?