Fix connection ID not incrementing when adding new connections#33
Fix connection ID not incrementing when adding new connections#33
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds conditional injection of an "id" default into newly created item tabs: when the item schema includes an Changes
Possibly Related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/dialogs/tst_adaptersettings.cpp`:
- Around line 203-208: Update the test in tst_adaptersettings.cpp so the
defaults include an "id" on the initial connection (e.g., add "id" to
defaultConn) to reproduce the regression where addItemTab() might reuse the
default id; then after calling addItemTab() assert that the newly added tab's id
is not the same as the seeded default but is incremented/unique (verify via the
same accessor used elsewhere in this test), ensuring the second tab's id is
generated rather than copied.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e5507f47-bc02-4594-8a1e-90ae36e90930
📒 Files selected for processing (3)
src/dialogs/adaptersettings.cpptests/dialogs/tst_adaptersettings.cpptests/dialogs/tst_adaptersettings.h
When adding new connection tabs, each new connection was getting the same "id" value copied from adapter defaults. Fix by assigning _nextItemTabIndex (the existing monotonic 1-based counter) to the "id" field when the item schema defines one, so connections are numbered 1, 2, 3, … consistently. Add test addTabIncrementsId to verify sequential assignment. https://claude.ai/code/session_01YHUJArN5sCs31hZDyntm1e
Seed the defaults with id=1 and pre-populate the config with one existing connection so _nextItemTabIndex starts at 2. The new tab must receive id=2, not copy the default id=1 — previously the test would have passed even if the explicit id override in addItemTab() were accidentally removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b9a5c1d to
e146b12
Compare
When adding new connection tabs, each new connection was getting the same
"id" value copied from adapter defaults. Fix by assigning _nextItemTabIndex
(the existing monotonic 1-based counter) to the "id" field when the item
schema defines one, so connections are numbered 1, 2, 3, … consistently.
Add test addTabIncrementsId to verify sequential assignment.
https://claude.ai/code/session_01YHUJArN5sCs31hZDyntm1e
Summary by CodeRabbit
Bug Fixes
Tests