Skip to content

lint格式修复 - #26

Closed
Brambledd wants to merge 4 commits into
huaweicloud-samples:masterfrom
Brambledd:bramble-gaussdb-node
Closed

lint格式修复#26
Brambledd wants to merge 4 commits into
huaweicloud-samples:masterfrom
Brambledd:bramble-gaussdb-node

Conversation

@Brambledd

Copy link
Copy Markdown

lint格式修复

Brambledd and others added 4 commits July 31, 2026 11:24
握手成功后通过 pg_is_in_recovery() 探测主机角色,角色不匹配
targetServerType 时销毁连接并跳到下一个候选 host。
- host-status-tracker: 区分已探测角色(MASTER/SLAVE)与待探测(CONNECT_OK)
- host-chooser: 无候选时仅回退到可探测 host (isHostProbingCandidate)

修复 client.js 中阻断该功能的若干笔误:
- _finalizeConnectSuccess 缺少调用括号,连接永远无法完成
- this.ConnectionParameters 大小写错误(应为 connectionParameters),握手时抛 TypeError
- _conecting / _roleProdePending 拼写错误导致状态不归位与判断失效
- connectionError 漏写下划线
- 'fronyend protocol' 拼写、角色不匹配错误消息引号未闭合

另新增 unsupported frontend protocol 3.51 时以 protocolMinor:0 回退重连。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- host-status-tracker: _isHostSuitable / isHostProbingCandidate / getCandidateHosts
  (含 master/slave/preferSlave 移除 CONNECT_OK 的语义、preferSlave 优先 standby)
- host-chooser: 无候选时的 probing fallback
- client: _isRoleAcceptable / _finalizeConnectSuccess / 角色探测全流程
  (匹配/不匹配/无法判定/probe出错/t-f字符串结果) / 协议回退(回退一次且不重复)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- client.js: 删除 const role 行尾多余空格
- target-server-type-tests.js: 协议回退测试长行换行

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
这些错误来自更早的 ut补充 / SHA256认证 提交,非本次 targetServerType
工作引入,但合并流水线跑全量 eslint 会因此失败。

- gaussdb-types.js / crypto-legacy-tests.js / inbound-parser.test.ts /
  parser.ts: prettier 格式 (eslint --fix),parser.ts 仅删行尾空格
- gaussdb-types.js: 删除未使用的 parseFloatArray / parseBoolArray
  (getTypeParser 无副作用且未导出)
- gaussdb-types-tests.js: require('../../../lib/defaults') 不再赋值给
  未使用的 defaults 变量,保留 defaults.js 类型注册副作用

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Brambledd Brambledd closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant