supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

fix(auth): handle uncaught promise rejections during initialization

Open 7ttp opened this issue 1 month ago • 1 comments

Problem

initialize() is called in the constructor without a .catch() handler. When using async storage adapters (e.g., Chrome extensions), lock acquisition timeouts or storage errors cause unhandled promise rejections that crash the application.

Solution

Add .catch() handlers to initialize(), broadcast channel message handler, and visibility change callback. Errors are logged via _debug() and remain retrievable via await client.initialize().

Related

  • Closes #2030

7ttp avatar Jan 18 '26 08:01 7ttp

Coverage Status

coverage: 80.955% (-0.04%) from 80.997% when pulling 60edfa5f8f7df39003631252e9abc08729a194b8 on 7ttp:fix/uncaught1 into 09aa10628b00cbdf65ace0f9e8e79237e7c0c1dc on supabase:master.

coveralls avatar Jan 18 '26 09:01 coveralls