docs(realtime): document relationship of accessToken() and heartbeat - #2680
Conversation
We had feedback, that the access token would become invalid before reaching another heartbeat to be able to refresh, when using a 3rd party auth provider. This was resolved by longer token life time, but the interplay of `accessToken()` and when it's called wasn't described in the docs. I'm not 100% sure if we want to document it in this detail, as it makes it harder for us to change later, but it also feels like this interaction should be documented so users can have better guidance on when to refresh their access tokens to not run into the same issue. I.e. in the sample we got the access token expired at ~148.6s passed and a new heartbeat would have only gone off at ~150s.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe pull request adds documentation for Merge Risk: ⚪ Minimal · up to This clarifies when Realtime refreshes third-party access tokens and how long tokens must remain valid to avoid channel expiry. No runtime behavior changes, and no current merge-readiness risk remains. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
accessToken() and heartbeataccessToken() and heartbeat
accessToken() and heartbeataccessToken() and heartbeat
We had feedback, that the access token would become invalid before reaching another heartbeat to be able to refresh, when using a 3rd party auth provider.
This was resolved by longer token life time, but the interplay of
accessToken()and when it's called wasn't described in the docs.I'm not 100% sure if we want to document it in this detail, as it makes it harder for us to change later, but it also feels like this interaction should be documented so users can have better guidance on when to refresh their access tokens to not run into the same issue. I.e. in the sample we got the access token expired at ~148.6s passed and a new heartbeat would have only gone off at ~150s.
📋 Checklist
<type>(<scope>): <description>pnpm nx formatto ensure consistent code formatting📝 Additional notes
Documentation is to the best of my (AI-assisted) understanding of how that part of the code works.