Skip to content

fix(remote): preserve feishu paired users#1678

Merged
zerob13 merged 1 commit into
devfrom
fix/feishu-pairing-save-race
May 26, 2026
Merged

fix(remote): preserve feishu paired users#1678
zerob13 merged 1 commit into
devfrom
fix/feishu-pairing-save-race

Conversation

@zhangmo8
Copy link
Copy Markdown
Collaborator

@zhangmo8 zhangmo8 commented May 26, 2026

Summary

  • preserve Feishu/Lark paired user IDs when saving general remote settings
  • add regression coverage for stale settings payloads overwriting pair state
  • document the bugfix with SDD artifacts

Tests

  • pnpm vitest run test/main/presenter/remoteControlPresenter/remoteControlPresenter.test.ts
  • pnpm run format
  • pnpm run i18n
  • pnpm run lint

Closes #1676

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed an issue where saving Feishu settings could overwrite paired user configurations. Settings now properly preserve existing paired user state while saving other configuration changes.
  • Documentation

    • Added comprehensive documentation for Feishu settings persistence, including specification and implementation plan.
  • Tests

    • Added regression test to verify paired user data remains intact when saving Feishu settings with empty paired user input.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ff0cf0bd-0c6f-4fa8-9ce1-d03f9990a239

📥 Commits

Reviewing files that changed from the base of the PR and between fcb2898 and 238df90.

📒 Files selected for processing (5)
  • docs/issues/feishu-pairing-save-race/plan.md
  • docs/issues/feishu-pairing-save-race/spec.md
  • docs/issues/feishu-pairing-save-race/tasks.md
  • src/main/presenter/remoteControlPresenter/index.ts
  • test/main/presenter/remoteControlPresenter/remoteControlPresenter.test.ts

📝 Walkthrough

Walkthrough

Fixes a race condition in Feishu/Lark Remote where periodic settings auto-save was overwriting pairedUserOpenIds with stale frontend data, erasing successful pairings. The fix preserves existing paired user IDs from storage, adds specification and planning docs, and includes a regression test.

Changes

Feishu Pairing Save Race Fix

Layer / File(s) Summary
Issue specification and planning
docs/issues/feishu-pairing-save-race/spec.md, docs/issues/feishu-pairing-save-race/plan.md, docs/issues/feishu-pairing-save-race/tasks.md
Documents the "Feishu Pairing Save Race" issue across spec, plan, and task checklist. Defines the problem (stale frontend auto-save erases paired users), goal, acceptance criteria (pair/unpair as exclusive modification path), implementation approach (preserve pairedUserOpenIds from storage), and test strategy.
Settings save fix and regression test
src/main/presenter/remoteControlPresenter/index.ts, test/main/presenter/remoteControlPresenter/remoteControlPresenter.test.ts
saveFeishuSettings() now preserves existing pairedUserOpenIds from current config instead of accepting it from frontend input. New unit test verifies paired user IDs remain unchanged when settings are saved with an empty pairedUserOpenIds array.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit hops through settings code,
Where paired IDs once went astray,
Now preserved along the road—
No more pairings lost midday! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main fix: preserving Feishu paired users during settings save operations.
Linked Issues check ✅ Passed The PR addresses all core objectives from issue #1676: fixes saveFeishuSettings to preserve pairedUserOpenIds [#1676], adds regression test coverage [#1676], and documents the fix with SDD artifacts.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the stated objectives: updating the presenter logic, adding regression tests, and documenting the implementation plan and spec.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/feishu-pairing-save-race

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zerob13 zerob13 merged commit 2195f29 into dev May 26, 2026
3 checks passed
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.

[Bug] Feishu/Lark Remote: pairedUserOpenIds lost after pairing due to settings save race condition

2 participants