fix(database): add error handling to getRemoteAgents and getRemoteAgent#1922
Merged
fix(database): add error handling to getRemoteAgents and getRemoteAgent#1922
Conversation
Wrap getRemoteAgents() and getRemoteAgent() in try-catch blocks to gracefully handle missing remote_agents table (e.g. when migration v16 fails). Returns safe defaults (empty array / null) instead of throwing unhandled SqliteError, consistent with other database methods. Fixes Sentry ELECTRON-FG (9 events).
Contributor
Code Review:fix(database): add error handling to getRemoteAgents and getRemoteAgent (#1922)变更概述本 PR 为 方案评估结论:✅ 方案合理 与 问题清单✅ 未发现明显问题,代码质量良好,建议批准合并。 汇总无问题。 结论✅ 批准合并 — 无阻塞性问题。修复精准、模式一致、有测试覆盖。 本报告由本地 CONCLUSION: APPROVED |
Contributor
|
✅ 已自动 review,代码无阻塞性问题。
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getRemoteAgents()andgetRemoteAgent()inAionUIDatabaseto gracefully handle cases where theremote_agentstable doesn't exist (e.g. when migration v16 fails)[]/null) instead of throwing unhandledSqliteError, consistent with other database methods likecreateRemoteAgent,updateRemoteAgent,deleteRemoteAgentSqliteError: no such table: remote_agents(9 events, last seen 6 hours ago)Test plan
remoteAgentBridge.test.tsverifying safe defaults when methods return[]/nullbunx tsc --noEmitcleanbun run lintclean