fix(typings): allow generic Error in authCallback callback#2099
fix(typings): allow generic Error in authCallback callback#2099owenpearson wants to merge 1 commit intomainfrom
Error in authCallback callback#2099Conversation
WalkthroughThe change widens error parameter types for authentication callbacks. In ably.d.ts, AuthOptions.authCallback’s first argument changes from ErrorInfo to Error. In src/common/lib/client/auth.ts, Auth.requestToken’s callback adds Error to its accepted error union. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)src/common/lib/client/auth.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
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 |
c648c24 to
c0bb437
Compare
We shouldn't be expecting users to construct their own
ErrorInfohere when their auth callback fails, since they won't know whatcodeto use. ISTM the typings here were written to conform to the internaltokenRequestCallbackvariable? The code seems to treat the error opaquely so just changing toErrorshould be safe. NB: not a breaking change since I've maintained thestringoption andErrorInfoinherits fromError.Summary by CodeRabbit
Bug Fixes
Refactor