Skip to content

fix(feishu): feishu connector name validate#797

Merged
hazeone merged 4 commits intomainfrom
cursor/bot-5a0d
Apr 8, 2026
Merged

fix(feishu): feishu connector name validate#797
hazeone merged 4 commits intomainfrom
cursor/bot-5a0d

Conversation

@hazeone
Copy link
Copy Markdown
Contributor

@hazeone hazeone commented Apr 8, 2026

This pull request contains changes generated by a Cursor Cloud Agent

Open in Web Open in Cursor 

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 8, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@hazeone hazeone changed the title 飞书 bot 中文名回复 fix(feishu): feishu connector name validate Apr 8, 2026
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a52178375d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1218 to +1220
const accountIdError = validateCanonicalAccountId(body.accountId);
if (accountIdError) {
sendJson(res, 400, { success: false, error: accountIdError });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve updates for legacy non-canonical account IDs

This new canonical-ID gate now rejects any persisted account ID that was created before this change (the previous UI allowed any non-empty value), so users with legacy IDs like uppercase/non-ASCII can no longer edit that account’s config and will also hit the same block on default-account/binding mutations. In upgrade scenarios, this effectively strands existing channel accounts unless users manually edit config files, so the validation should be scoped to new IDs or paired with a migration/normalization path.

Useful? React with 👍 / 👎.

@hazeone hazeone merged commit d03902d into main Apr 8, 2026
5 checks passed
@hazeone hazeone deleted the cursor/bot-5a0d branch April 8, 2026 11:16
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d942d12f3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +107 to +110
const trimmed = accountId.trim();
if (!trimmed) return 'accountId cannot be empty';
if (isCanonicalOpenClawAccountId(trimmed)) {
return null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize account IDs before applying route mutations

The new validator checks accountId.trim() for canonical format, but downstream routes still use the original raw body.accountId. This means a request like "feishu-main " passes validation (because trimmed value is canonical) yet /api/channels/config can still persist a non-canonical key with trailing whitespace, undermining the routing-safety guarantee this change introduces and causing hard-to-target account IDs later. Return/use the normalized trimmed ID from validation for all subsequent mutations.

Useful? React with 👍 / 👎.

Comment on lines +95 to +97
const configuredAccounts = listConfiguredChannelAccountsFromConfig(config) ?? {};
const storedChannelType = resolveStoredChannelType(channelType);
const knownAccountIds = configuredAccounts[storedChannelType]?.accountIds ?? [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Allow legacy-ID checks to include disabled channel sections

Legacy ID compatibility is now decided via listConfiguredChannelAccountsFromConfig(config), but that helper skips channels where enabled === false. In that state, previously persisted non-canonical account IDs are treated as unknown and get rejected by the new 400 validation path on config/default-account/binding routes, so users with disabled channels can be blocked from managing those legacy accounts until they edit config manually. Backward-compat lookup should read account IDs from config regardless of enabled flag.

Useful? React with 👍 / 👎.

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.

2 participants