Fixed an issue where modifying a shared server incorrectly updated the original server details. #9258#9668
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughReplaces a direct Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 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 `@web/pgadmin/browser/server_groups/servers/__init__.py`:
- Around line 1468-1473: The code unconditionally calls
db.session.expunge(server) which can raise or be a no-op for detached instances;
update the block in the connect flow to check
sqlalchemy.orm.session.object_session(server) (or db.session.object_session) and
only call db.session.expunge(server) when that returns a truthy session; keep
the surrounding logic that loads shared_server via
ServerModule.get_shared_server and ServerModule.get_shared_server_properties
as-is, but guard the expunge call using object_session(server) to safely handle
both attached and detached Server instances.
…e original server details. pgadmin-org#9258
b7514ce to
a164f8b
Compare
Summary by CodeRabbit