supabase / auth-helpers

A collection of framework specific Auth utilities for working with Supabase.
https://supabase.github.io/auth-helpers/
MIT License
892 stars 240 forks source link

fix: small improvements/fixes to cookie chunker in ssr #760

Closed hf closed 2 months ago

hf commented 2 months ago

Fixes/improves some edge cases in the cookie chunker for ssr:

  1. deleteChunks now attempts to delete both the key and potential leftover chunks, instead of deleting the first thing it notices. This should decrease the total size of cookies by removing orphaned chunks, and also is a bit safer in situations where leftover chunks are mistaken as the continuation of other chunks.
  2. Avoid using parallel cookie setting in setItem, and instead do it serially.
  3. setItem first clears all chunks before setting the new ones.
hf commented 2 months ago

One confirmed support ticket that is demonstrating the issues resolved by these changes.

kangmingtay commented 2 months ago

@hf remember to generate a changeset too!

glib-0 commented 2 months ago

Does this change fix the bug I just submitted? #766

hf commented 2 months ago

Does this change fix the bug I just submitted? #766

Maybe...