Repository navigation
Commit 38a6a4e
authored
fix: defer eager requests in storage, auth, and functions hooks (#757)
* fix: defer eager requests in storage, auth, and functions hooks
useStorageDownloadURL, useIdTokenResult, and useCallableFunctionResponse
built their request in the render body, so a discarded request fired on
every render (and, for a missing storage object, an unhandled promise
rejection). Wrap each in rxjs `defer` so the request is created lazily on
subscription. useObservable subscribes once per observableId, so the
request now runs once instead of once per render.
Adds a regression test for useIdTokenResult confirming the deferred
factory runs exactly once across re-renders (4 calls without the wrapper).
Closes #743, #744.
* docs: regenerate reference docs for defer import line shifts
* test: add call-count regression test for useCallableFunctionResponse
Mirrors the useIdTokenResult defer test: asserts the underlying
callable is invoked once across re-renders. Addresses Armando's
non-blocking follow-up on #757.
* fix: preserve httpsCallable generics on mocked implementation
getMockImplementation() erases the generic signature, breaking the
explicit type arguments on originalImpl<...>() under strict mode.
Cast to typeof httpsCallable to keep it. Failed Type check (React
18/19) in CI, tsconfig.json alone doesn't cover test/.1 parent dd468b5 commit 38a6a4e
21 files changed
Lines changed: 107 additions & 38 deletions
File tree
- docs/reference
- functions
- interfaces
- type-aliases
- src
- test
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments