Skip to content

[WIP] Resolve references before copying entries to another database #12201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 15, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Overview

REF for username/password in other (but also already opened) DB

Examples

  1. clone entry, create in clone REF: for username and password for original entry in same DB
  2. clone's username and password refer to correct values
  3. move the clone to another also opened db
  4. clone's username and password don't refer to correct values anymore, they're just empty

Context

I open a master DB. In it a slave DB is additionally opened via theAutoOpen group. So if I open the master DB, the other one is "daisy chained". I'd like to use REF for entries not only in one DB but across these DBs.

Fixes #7450.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link

codecov bot commented Jun 15, 2025

Codecov Report

Attention: Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.

Project coverage is 63.91%. Comparing base (c4b4be4) to head (af5261d).
Report is 12 commits behind head on develop.

Files with missing lines Patch % Lines
src/core/Entry.cpp 94.74% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12201      +/-   ##
===========================================
+ Coverage    63.89%   63.91%   +0.02%     
===========================================
  Files          369      369              
  Lines        38943    38962      +19     
===========================================
+ Hits         24882    24901      +19     
  Misses       14061    14061              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@droidmonkey
Copy link
Member

Try this plan again

Copy link
Contributor Author

Copilot AI commented Jun 19, 2025

Try this plan again

I've implemented a solution that resolves references before moving entries to different databases. The fix adds a new method resolveReferencesBeforeDatabaseMove() that's called in Entry::setGroup() when an entry is moved between databases. This ensures references are resolved using the original database before the move, preserving the actual values instead of leaving broken references. Added test case to verify the fix works correctly. Commit c5a9b46.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 224.0.0.251
  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from droidmonkey June 19, 2025 14:12
Copilot finished work on behalf of droidmonkey June 19, 2025 14:12
@droidmonkey
Copy link
Member

Check your solution again now that you have new instructions and environment.

Copy link
Contributor Author

Copilot AI commented Jun 19, 2025

Check your solution again now that you have new instructions and environment.

I've reviewed and improved my solution with the new instructions and environment. The fix now properly handles edge cases where references cannot be resolved - instead of replacing them with empty strings, it preserves the original reference text. All tests pass including the comprehensive cross-database reference test. Applied code formatting and updated translations as required. Commit af5261d.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 184.155.130.134.in-addr.arpa
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • de.login.keepassxc.org
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • keepassxc.co.uk
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • keepassxc.org
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • login.keepassxc.co.uk
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • login.keepassxc.org
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)
  • test.com
    • Triggering command: /home/REDACTED/work/keepassxc/keepassxc/build/tests/testicondownloader (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of droidmonkey June 19, 2025 14:41
@phoerious phoerious added the pr: ai-assisted Pull request contains significant contributions by generative AI label Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: ai-assisted Pull request contains significant contributions by generative AI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve references before copying entries to another database
3 participants