Skip to content
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

Group tags issue #53

Open
mstoecklein opened this issue Mar 29, 2023 · 1 comment
Open

Group tags issue #53

mstoecklein opened this issue Mar 29, 2023 · 1 comment

Comments

@mstoecklein
Copy link

Hello,

I am using the latest version 2.1.1. At first I thought I did something wrong, but after doing a separate test it seems like a bug in the save function. Group tags are not written into the output file.

import {default as kdbxweb} from 'kdbxweb';
import { writeFileSync } from 'fs';

const credentials = new kdbxweb.Credentials(kdbxweb.ProtectedValue.fromString('test'));

const db = kdbxweb.Kdbx.create(credentials, 'title');

const group = db.createGroup(db.getDefaultGroup(), 'Tagged Group');
// will not be saved in groups
group.tags = ['tag1', 'tag2'];

const entry = db.createEntry(group, 'Tagged Entry');
// will be saved in entries
entry.tags = ['tag1', 'tag2'];

const data = await db.saveXml();
writeFileSync('test.xml', data);

Here is the XML output of the KDBX file I get:

https://gist.github.com/mstoecklein/e2686de4c22a263240e75db6745df6ac

@luckyrat
Copy link

new databases default to kdbx v4.0 and no automatic upgrade to v4.1 occurs when you use v4.1 features.

Thus, you should be able to fix a problem like this by setting the header minor version to 1 after creation:

db.header.versionMinor = 0;

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

No branches or pull requests

2 participants