jschuur / coworking.party

Virtual coworking communities to keep people motivated and have a little fun.
https://coworking.party
7 stars 1 forks source link

BUG: Users sometimes take on the identify of another account #4

Closed jschuur closed 2 months ago

jschuur commented 2 months ago

As demo'd by @tdrayson and Dr_DinoMight.

jschuur commented 2 months ago

Possibly something to do with the jotai implementation that is used for the UserData state running in a server component?

See this backend error

Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044

Start with making the PartyKit component 'use client'

jschuur commented 2 months ago

I've wrapped everything in a jotai provider and explicitly made PartyKit client component just in case. Hopefully the former should fix this issue.

jschuur commented 2 months ago

Nope, bug is still happening.

When it does happen, the Account component shows the profile image from useSession data, so this seems to be a Next Auth issue.

jschuur commented 2 months ago

Haven't seen or heard of this happen for about a day now.

jschuur commented 2 months ago

Haven't seen this since the change to JWT sessions and move to an Edge specific config, so calling this fixed.